Closed mattn closed 7 years ago
Good question. I think we should handle a proxy, but that may interact with #7 .
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.
@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.
@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
But some values of fields may not be a real for latency if httpstat support proxy.