davecheney / httpstat

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

Do you have plan to support proxy? #67

Closed mattn closed 7 years ago

mattn commented 7 years ago

But some values of fields may not be a real for latency if httpstat support proxy.

davecheney commented 7 years ago

Good question. I think we should handle a proxy, but that may interact with #7 .

inkel commented 7 years ago

According to this StackOverflow answer it is possible to use a proxy by setting HTTP_PROXY. It can also be set programmatically, though perhaps supporting both environment and flag is the most adequate solution.

davecheney commented 7 years ago

@inkel at the moment with the hand rolled way of making the connection, negotiating the handshake, then writing the request directly I'm pretty confident that the current code doesn't deal with proxies at all.

Using the httptrace mechanism sounds better, but I'm sure there will be a request to break out the proxy latency, its connection, its https handshake, etc.

mattn commented 7 years ago

@inkel it's easy to do.

I've implemented this feature in my product.

https://github.com/mattn/http-gonsole/blob/master/http-gonsole.go#L78