It's like curl -v, with colours.

httpstat Build Status

Go Report Card

Shameless

Imitation is the sincerest form of flattery.

But seriously, https://github.com/reorx/httpstat is the new hotness, and this is a shameless rip off.

Installation

httpstat requires Go 1.11 or later.

$ go get github.com/davecheney/httpstat

Usage

$ httpstat https://example.com/

Features

  • Windows/BSD/Linux supported.
  • HTTP and HTTPS are supported, for self signed certificates use -k.
  • Skip timing the body of a response with -I.
  • Follow 30x redirects with -L.
  • Change HTTP method with -X METHOD.
  • Provide a PUT or POST request body with -d string. To supply the PUT or POST body as a file, use -d @filename.
  • Add extra request headers with -H 'Name: value'.
  • The response body is usually discarded, you can use -o filename to save it to a file, or -O to save it to the file name suggested by the server.
  • HTTP/HTTPS proxies supported via the usual HTTP_PROXY/HTTPS_PROXY env vars (as well as lower case variants).
  • Supply your own client side certificate with -E cert.pem.

Contributing

Bug reports are most welcome, but with the exception of #5, this project is closed.

Pull requests must include a fixes #NNN or updates #NNN comment.

Please discuss your design on the accompanying issue before submitting a pull request. If there is no suitable issue, please open one to discuss the feature before slinging code. Thank you.

Comments
  • Change color scheme

    Change color scheme

    Fixes #5

    Changes:

    • Remove grayscale
    • Use bold in header of template
    • Use blue color instead of cyan

    IMHO it's a lot more readable now on white backgrounded ttys and also readable on black: 2016-09-28 14 26 39 screenshot

  • (Option to) show which IP is being connected to

    (Option to) show which IP is being connected to

    My applications often have numerous IPs (CDNs, etc), so showing which IP is being connected to is helpful.

    (Along the same lines, an option to connect to a particular IP could also be helpful; along the lines of the -x or --resolv options from curl).

  • http2 tracing is broken on windows

    http2 tracing is broken on windows

    I'm testing httpstat on a Windows machine and I get a huge TCP Connection time.

    D:\>httpstat http://139.110.74.200/dsrv/status
    
    Connected to 139.110.74.200:80
    
    HTTP/1.1 200 OK
    Server: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.4.16
    Content-Type: text/xml
    Date: Thu, 11 Aug 2016 09:36:27 GMT
    X-Powered-By: PHP/5.4.16
    
    Body discarded
    
       DNS Lookup   TCP Connection   Server Processing   Content Transfer
    [       0ms  |     9223372036854ms  |              9ms  |             1ms  ]
                 |                |                   |                  |
        namelookup:0ms            |                   |                  |
                            connect:9223372036854ms         |                  |
                                          starttransfer:9223372036854ms        |
                                                                     total:922337203
    6854ms
    

    I have tried changing the HTTP_PROXY variable and when using a local cntlm proxy it goes back to something reasonable:

    D:\>set HTTP_PROXY=localhost:3128
    
    D:\>set HTTPS_PROXY=localhost:3128
    
    D:\>httpstat http://139.110.74.200/dsrv/status
    
    Connected to 127.0.0.1:3128
    
    HTTP/1.1 200 OK
    Server: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.4.16
    Accept-Ranges: none
    Content-Length: 415
    Content-Type: text/xml
    Date: Thu, 11 Aug 2016 09:43:50 GMT
    Proxy-Connection: close
    Via: 1.1 gproxy.postal.local:8080
    X-Powered-By: PHP/5.4.16
    
    Body discarded
    
       DNS Lookup   TCP Connection   Server Processing   Content Transfer
    [       0ms  |           0ms  |             29ms  |             0ms  ]
                 |                |                   |                  |
        namelookup:0ms            |                   |                  |
                            connect:0ms               |                  |
                                          starttransfer:29ms             |
                                                                     total:29ms
    

    I can provide additional information if needed.

    (Thanks for this tool, it is awesome !)

  • GNU command line flag handling using go-flags

    GNU command line flag handling using go-flags

    While reviewing the PR to add version output to httpstat, I thought it would be nice to have parity with curl's flag. In addition to that, with us aiming for a 1.0 release, it'd be nice to have assertions around the command line argument parsing.

    This changeset changes the command line flag parsing from the standard library to that of go-flags. The way go-flags is consumed here is a bit complicated, but it's so that we can abstract functionality away and properly unit test all command line flag parsing.

    This also fixes a bug in the error handling around the output file creation. Previously, if the file couldn't be created it may have used the wrong filename in the error message.

  • install failed

    install failed

    When I use installation command, I failed.

    $ go get -u github.com/davecheney/httpstat                                                                                   [10:56:20]
    # github.com/davecheney/httpstat
    failed MSpanList_Insert 0x7925c0 0xeb13f9b6bae5 0x0 0x0
    fatal error: MSpanList_Insert
    
    runtime stack:
    runtime.throw(0x2a3330, 0x10)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:530 +0x90
    runtime.(*mSpanList).insert(0x3a68a8, 0x7925c0)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:933 +0x293
    runtime.(*mheap).freeSpanLocked(0x3a60a0, 0x7925c0, 0x100, 0x0)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:809 +0x4be
    runtime.(*mheap).grow(0x3a60a0, 0x30, 0x0)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:675 +0x2a0
    runtime.(*mheap).allocSpanLocked(0x3a60a0, 0x30, 0x4c2fb20)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:553 +0x4e3
    runtime.(*mheap).alloc_m(0x3a60a0, 0x30, 0x100000000, 0x7924d0)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:437 +0x119
    runtime.(*mheap).alloc.func1()
            /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:502 +0x41
    runtime.systemstack(0x7fff5fbfe910)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:307 +0xab
    runtime.(*mheap).alloc(0x3a60a0, 0x30, 0x100000000, 0xc820022000)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:503 +0x63
    runtime.largeAlloc(0x60000, 0xc800000003, 0x4d2d0)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/malloc.go:766 +0xb3
    runtime.mallocgc.func3()
            /usr/local/Cellar/go/1.6/libexec/src/runtime/malloc.go:664 +0x33
    runtime.systemstack(0x39f700)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:291 +0x79
    runtime.mstart()
            /usr/local/Cellar/go/1.6/libexec/src/runtime/proc.go:1048
    
    goroutine 1 [running]:
    runtime.systemstack_switch()
            /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:245 fp=0xc824a3b508 sp=0xc824a3b500
    runtime.mallocgc(0x60000, 0x0, 0xc800000003, 0x8)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/malloc.go:665 +0x9eb fp=0xc824a3b5e0 sp=0xc824a3b508
    runtime.rawmem(0x60000, 0x2f)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/malloc.go:809 +0x32 fp=0xc824a3b608 sp=0xc824a3b5e0
    runtime.growslice(0x1e80a0, 0xc824ccc000, 0x4c000, 0x4c000, 0x4c001, 0x0, 0x0, 0x0)
            /usr/local/Cellar/go/1.6/libexec/src/runtime/slice.go:95 +0x233 fp=0xc824a3b678 sp=0xc824a3b608
    cmd/link/internal/ld.Symgrow(0xc820082240, 0xc824a10fc0, 0x4c002)
            /usr/local/Cellar/go/1.6/libexec/src/cmd/link/internal/ld/data.go:52 +0x26e fp=0xc824a3b730 sp=0xc824a3b678
    cmd/link/internal/ld.addpctab(0xc824a10fc0, 0xc80004bfbc, 0xc820ecc030, 0x4bfbc)
            /usr/local/Cellar/go/1.6/libexec/src/cmd/link/internal/ld/pcln.go:130 +0x6a fp=0xc824a3b7b0 sp=0xc824a3b730
    cmd/link/internal/ld.pclntab()
            /usr/local/Cellar/go/1.6/libexec/src/cmd/link/internal/ld/pcln.go:323 +0x8d1 fp=0xc824a3b9e0 sp=0xc824a3b7b0
    cmd/link/internal/ld.Ldmain()
            /usr/local/Cellar/go/1.6/libexec/src/cmd/link/internal/ld/pobj.go:241 +0x1f33 fp=0xc824a3be60 sp=0xc824a3b9e0
    cmd/link/internal/amd64.Main()
            /usr/local/Cellar/go/1.6/libexec/src/cmd/link/internal/amd64/obj.go:44 +0x19 fp=0xc824a3be68 sp=0xc824a3be60
    main.main()
            /usr/local/Cellar/go/1.6/libexec/src/cmd/link/main.go:27 +0x36f fp=0xc824a3bf40 sp=0xc824a3be68
    runtime.main()
            /usr/local/Cellar/go/1.6/libexec/src/runtime/proc.go:188 +0x2b0 fp=0xc824a3bf90 sp=0xc824a3bf40
    runtime.goexit()
            /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc824a3bf98 sp=0xc824a3bf90
    

    I install go using homebrew

    $ go version                                                                                                                 [22:45:15]
    go version go1.6 darwin/amd64
    
  • make cmd --help write to stdout

    make cmd --help write to stdout

    httpstat --help writes to stderr, which makes output not greppable.

    For example following will fail: httpstat --help | grep <pattern>

    From user perspective cmd --help , which outputs to stderr is also confusing, as there is no any indication of error.

    This PR fixes this confusion.

  • Golang 1.8 - Use ClientTrace.TLSHandshakeStart and TLSHandshakeDone

    Golang 1.8 - Use ClientTrace.TLSHandshakeStart and TLSHandshakeDone

    Use ClientTrace.TLSHandshakeStart/HandshakeDone from incoming go 1.8: https://github.com/golang/go/commit/abdd73cc43f9187e8918879944ec0dacbc912b5c

    This PR probably should be blocked until 1.8 is released

  • No support for http2

    No support for http2

    httpstat master $ curl -I https://www.google.com
    HTTP/2.0 302
    cache-control:private
    content-type:text/html; charset=UTF-8
    location:https://www.google.be/?gfe_rd=cr&ei=ycnqV5PxMKGk8wfZpZmoBg
    content-length:259
    date:Tue, 27 Sep 2016 19:34:33 GMT
    alt-svc:quic=":443"; ma=2592000; v="36,35,34,33,32"
    
    httpstat master $ ./httpstat https://www.google.com
    
    Connected to 216.58.212.228:443
    
    HTTP/1.1 302 Found
    Alt-Svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
    Cache-Control: private
    Content-Length: 259
    Content-Type: text/html; charset=UTF-8
    Date: Tue, 27 Sep 2016 19:34:39 GMT
    Location: https://www.google.be/?gfe_rd=cr&ei=z8nqV9yNHqrH8AeTm6qQCQ
    
      DNS Lookup   TCP Connection   TLS Handshake   Server Processing   Content Transfer
    [      5ms  |          31ms  |         93ms  |             32ms  |             0ms  ]
                |                |               |                   |                  |
       namelookup:5ms            |               |                   |                  |
                           connect:36ms          |                   |                  |
                                       pretransfer:130ms             |                  |
                                                         starttransfer:162ms            |
                                                                                    total:162ms    
    
  • Increase separation of concerns in colour formatting code

    Increase separation of concerns in colour formatting code

    Currently the formatting of coloured output is handled before passing the string to fmt.Printf. As an exercise I would like to see if it is possible to make the type of the argument passed to fmt.Printf implement fmt.Formatter and handle the colorisation of the output at the point at which it is printed.

    note to implementors: this has no impact on the performance or memory usage of this program, in fact it'll probably make it infinitesimally slower and larger. I'm mainly interested in exploring this to improve the separation of concerns between the code that prepares the output, and the code that colourises it.

  • Too many colons

    Too many colons

    First, this is awesome, thanks for making a Go version of this!

    But it doesn't like when I need to specify a port:

    httpstat "http://45.56.15.67:8680/"
    2016/09/23 09:03:11 unable to resolve host: too many colons in address 45.56.15.67:8680:80
    

    (Believe me, I wish this was just on port 80 like every other website. But I'm having connectivity issues to it which is why I thought I'd try httpstat, ha.)

  • Package exists but is not a directory

    Package exists but is not a directory

    I'm getting the following error trying to install this package

    go get -u github.com/davecheney/httpstat
    package github.com/davecheney/httpstat/vendor/github.com/fatih/color: /Users/wayne/go/src/github.com/davecheney/httpstat/vendor/github.com/fatih/color/.git exists but is not a directory
    package github.com/davecheney/httpstat/vendor/golang.org/x/net/http2: /Users/wayne/go/src/github.com/davecheney/httpstat/vendor/golang.org/x/net/.git exists but is not a directory
    

    Tried cleaning my $GOPATH and didn't make a difference.

    sudo rm -r $GOPATH
    mkdir $GOPATH
    

    System Details

    go version go1.8.1 darwin/amd64
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/wayne/go"
    GORACE=""
    GOROOT="/usr/local/Cellar/go/1.8.1/libexec"
    GOTOOLDIR="/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64"
    GCCGO="gccgo"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8s/j9vt85xs4ps80919tlwsxdk00000gn/T/go-build266113172=/tmp/go-build -gno-record-gcc-switches -fno-common"
    CXX="clang++"
    CGO_ENABLED="1"
    PKG_CONFIG="pkg-config"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    GOROOT/bin/go version: go version go1.8.1 darwin/amd64
    GOROOT/bin/go tool compile -V: compile version go1.8.1 X:framepointer
    uname -v: Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64
    ProductName:	Mac OS X
    ProductVersion:	10.12.4
    BuildVersion:	16E195
    lldb --version: lldb-370.0.42
      Swift-3.1
    
  • Add gorealeaser to create binaries

    Add gorealeaser to create binaries

    Would be nice to have prebuilt binaries for this tool. This PR will add a github action using goreleaser to create binaries after creating a github release.

    If anyone is interested in having such binaries they are currently available here https://github.com/gabrie30/httpstat/releases

  • httpstat returns 403, doesn't hide timings

    httpstat returns 403, doesn't hide timings

    I built the project by downloading the git and running "go build" instead of the supplied command because I got an error

    can't load package: package github.com/davecheney/httpstat@latest: can only use path@version syntax with 'go get'
    

    When I use the following command: ./httpstat -I -L https://pieterhouwen.info I get the following output:

    image

    When I use curl on the same website it works fine.

    What is the reason for this 403 and wasn't the -I parameter supposed to hide the timings?

  • Flag: don't discard body, add syntax highlighting

    Flag: don't discard body, add syntax highlighting

    Body discarded
    

    Let's make it possible to not discard the body with a flag, e.g. httpstat -b. It'd be way nicer than httpstat -o /dev/stdout.

    Additionally, if Content-Type is something meaningful like application/json, syntax highlight it.

  • DNS through socks5 proxy

    DNS through socks5 proxy

    Thanks for this beautiful tool. This is a feature request to support "DNS through proxy".

    curl supports this via socks5h like in socks5h://127.0.0.1:1080.

  • Add option to specify additional CA certificates for SSL peer validation

    Add option to specify additional CA certificates for SSL peer validation

    Adds an option that allows the user to specify a file of one or more CA certificates that can be used for SSL peer validation. These CA certificates are added to the default pool of CA certificates that are used by Go.

    Fixes #146

Related tags
Jun 6, 2022
protoCURL is cURL for Protobuf: The command-line tool for interacting with Protobuf over HTTP REST endpoints using human-readable text formats

protoCURL protoCURL is cURL for Protobuf: The command-line tool for interacting with Protobuf over HTTP REST endpoints using human-readable text forma

Jan 6, 2023
DeepValueNetwork is a peer-to-peer database network managed and hosted by its community.

DeepValueNetwork To understand what DeepValueNetwork will be, I suggest you read this document. In progress This software is currently being developed

Dec 10, 2022
Antenna RPC is an RPC protocol for distributed computing, it's based on QUIC and Colfer. its currently an WIP.

aRPC - Antenna Remote Procedure Call Antenna remote procedure call (aRPC) is an RPC protocol focused on distributed processing and HPC. aRPC is implem

Jun 16, 2021
For your server and all of its waifus <3

waifud A few tools to help me manage and run virtual machines across a homelab cluster. waifud was made for my own personal use and I do not expect it

Dec 12, 2022
🎉 An awesome version control tool for protoc and its related plugins.
🎉 An awesome version control tool for protoc and its related plugins.

❤️ PowerProto is actively maintained! Any questions in use can be directly raised issue, I will respond to you as fast as possible. If you think the p

Dec 29, 2022
Terraform ACI Provider. Started before Cisco's release and stopped when Cisco released its own.

terraform-provider-aci This was before Cisco released their own (I did ask them if they were doing one and they said no !!) :-) I would have liked to

Nov 10, 2021
Coral, a friendly Cobra fork with nearly all its features, but only 4 dependencies
Coral, a friendly Cobra fork with nearly all its features, but only 4 dependencies

Coral Preamble I love Cobra and I love Viper. They are great projects, incredibly useful and outstandingly important for the Go community. But sometim

Dec 29, 2022
A suite of gRPC debugging tools. Like Fiddler/Charles but for gRPC.

grpc-tools A suite of tools for gRPC debugging and development. Like Fiddler/Charles but for gRPC! The main tool is grpc-dump which transparently inte

Dec 22, 2022
httpie-like HTTP client written in Go
httpie-like HTTP client written in Go

httpie-go httpie-go (ht) is a user-friendly HTTP client CLI. Requests can be issued with fewer types compared to curl. Responses are displayed with sy

Dec 9, 2022
A shazam like tool to store songs fingerprints and retrieve them
A shazam like tool to store songs fingerprints and retrieve them

musig ?? A shazam-like tool that allows you to compute song's fingerprints and reverse lookup song names. It's more or less an implementation of the s

Dec 12, 2022
kcp is a prototype of a Kubernetes API server that is not a Kubernetes cluster - a place to create, update, and maintain Kube-like APis with controllers above or without clusters.
kcp is a prototype of a Kubernetes API server that is not a Kubernetes cluster - a place to create, update, and maintain Kube-like APis with controllers above or without clusters.

kcp is a minimal Kubernetes API server How minimal exactly? kcp doesn't know about Pods or Nodes, let alone Deployments, Services, LoadBalancers, etc.

Jan 6, 2023
Verify IP addresses of respectful crawlers like Googlebot by reverse dns and forward dns lookups
Verify IP addresses of respectful crawlers like Googlebot by reverse dns and forward dns lookups

goodbots - trust but verify goodbots verifies the IP addresses of respectful crawlers like Googlebot by performing reverse dns and forward dns lookups

Aug 16, 2022
Automatically compress podcasts to tiny file sizes for bandwidth constrained devices like cellular.
Automatically compress podcasts to tiny file sizes for bandwidth constrained devices like cellular.

tinycast Automatically compress podcasts to tiny file sizes for bandwidth constrained connections like cellular or satellite.

Sep 18, 2022
Scalable WebRTC Signaling Server with ayame-like protocol.

ayu ayu is WebRTC Signaling Server with ayame-like protocol. Scalable: ayu uses Redis to store room states, so it can be used on serverless platforms

Nov 11, 2022
Fork of Go stdlib's net/http that works with alternative TLS libraries like refraction-networking/utls.

github.com/ooni/oohttp This repository contains a fork of Go's standard library net/http package including patches to allow using this HTTP code with

Sep 29, 2022
Like grpcurl and cobra had a baby
Like grpcurl and cobra had a baby

EXPERIMENTAL: this repo is in its infancy stage atm so there are a lot of features aren't supported grpctl /'grp-cuttle'/ A dynamic cli for interactin

Dec 29, 2022
Events - Event Manager - Nodejs like

events Event Manager - Nodejs like Please take a look at the TESTS, for further comprehension. Example package main import ( "errors" "fmt" "log"

Dec 31, 2021