davecheney / httpstat

It's like curl -v, with colours.
MIT License
6.95k stars 382 forks source link

No support for http2 #76

Closed bendem closed 7 years ago

bendem commented 7 years ago
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    
moorereason commented 7 years ago

The httptrace PR works great with HTTP/2. :wink:

moorereason commented 7 years ago

http.Request.Write writes an HTTP/1.1 request.

moorereason commented 7 years ago

@davecheney, I'm curiously confused. HTTP/2 not working after merging #7.

davecheney commented 7 years ago

Looks like it does :)

zapf(~/src/github.com/davecheney/httpstat) % httpstat https://http2.akamai.com/

Connected to 104.74.30.17:443

HTTP/1.1 200 OK
Server: Apache
Accept-Ch: DPR, Width, Viewport-Width, Downlink, Save-Data
Access-Control-Allow-Credentials: false
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: GET,HEAD,POST
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 86400
Cache-Control: max-age=43200
Client_ip: 121.44.254.89
Client_real_ip: 121.44.254.89
Content-Length: 11502
Content-Type: text/html;charset=UTF-8
Date: Wed, 28 Sep 2016 02:09:23 GMT
Etag: "5e9139516a4f3d7a27577441623ca90d:1465962509"
Expires: Wed, 28 Sep 2016 14:09:23 GMT
Ghost_ip: 104.74.30.17
Ghost_service_ip: 104.72.70.92
Link: <https://ds-aksb-a.akamaihd.net>;rel="preconnect",<https://www.youtube.com>;rel="preconnect"
Myproto: 
Protocol_negotiation: h1
Push: true
Rtt: 20
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Akamai-Transformed: 9 10395 0 pmb=mRUM,1
Connection: keep-alive

Body discarded

  DNS Lookup   TCP Connection   TLS Handshake   Server Processing   Content Transfer
[    416ms  |          17ms  |        104ms  |            253ms  |             0ms  ]
            |                |               |                   |                  |
   namelookup:416ms          |               |                   |                  |
                       connect:434ms         |                   |                  |
                                   pretransfer:539ms             |                  |
                                                     starttransfer:792ms            |
                                                                                total:793ms 
moorereason commented 7 years ago

@davecheney, reopen, please.

Look again:

Connected to 104.74.30.17:443

HTTP/1.1 200 OK
davecheney commented 7 years ago

shit.

moorereason commented 7 years ago

I'm hot on this bug's trail. Give me a few mins...

bendem commented 7 years ago

Awesome, thanks