Files
kubernetes/vendor/github.com/elazarl/goproxy/examples/goproxy-basic
Tim Hockin 3c0c5ed4e0 Move deps from _workspace/ to vendor/
godep restore
pushd $GOPATH/src/github.com/appc/spec
git co master
popd
go get go4.org/errorutil
rm -rf Godeps
godep save ./...
git add vendor
git add -f $(git ls-files --other vendor/)
git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
2016-05-08 20:30:21 -07:00
..
2016-05-08 20:30:21 -07:00

Simple HTTP Proxy

goproxy-basic starts an HTTP proxy on :8080. It only handles explicit CONNECT requests.

Start it in one shell:

goproxy-basic -v

Fetch goproxy homepage in another:

http_proxy=http://127.0.0.1:8080 wget -O - \
	http://ripper234.com/p/introducing-goproxy-light-http-proxy/

The homepage HTML content should be displayed in the console. The proxy should have logged the request being processed:

2015/04/09 18:19:17 [001] INFO: Got request /p/introducing-goproxy-light-http-proxy/ ripper234.com GET http://ripper234.com/p/introducing-goproxy-light-http-proxy/
2015/04/09 18:19:17 [001] INFO: Sending request GET http://ripper234.com/p/introducing-goproxy-light-http-proxy/
2015/04/09 18:19:18 [001] INFO: Received response 200 OK
2015/04/09 18:19:18 [001] INFO: Copying response to client 200 OK [200]
2015/04/09 18:19:18 [001] INFO: Copied 44333 bytes to client error=<nil>