davecheney / httpstat

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

Add proxy support #82

Closed moorereason closed 8 years ago

moorereason commented 8 years ago

Fixes #67

davecheney commented 8 years ago

I'm -1 on adding another flag. proxy's are already done via http_proxy which the http package should just pick up automatically.

Can we get away with this and avoid adding another flag?

davecheney commented 8 years ago

ie, doesn't http.ProxyFromEnv give us this for free?

moorereason commented 8 years ago

Again, I'm caught up trying to match curl's options. :smile: Reworked to use the env. I like it.

Not sure how to automate tests, but here's how I'm manually testing:

go get github.com/elazarl/goproxy
cd $GOPATH/src/github.com/elazarl/goproxy/examples/goproxy-basic
go run main.go -v
davecheney commented 8 years ago

LGTM. Thanks.

davecheney commented 8 years ago

Yeah, I did some manual testing against a local polipo(1) installed on a machine on my network. I'm happy that setting HTTPS_PROXY et al to the wrong value causes the connection to fail which means those values are being picked up from the env correctly.

I don't think we need too much testing here, we're reusing a well tested component from the net/http package.