This is a squid-like HTTP proxy based on github@smartystreets/cproxy. This git repo is to use the Cproxy library and web app from it as binary artifact can be reused every, as such using any http proxy (Squid, .. so on)
- docker (v20 or above)
- docker-compose ( v1.29.x or above)
Download it check release page https://github.com/abdennour/go-http-proxy/releases/tag/v1.0.0
Install it in Linux
curl -LO https://github.com/abdennour/go-http-proxy/releases/download/v1.0.0/go-http-proxy-linux-amd64 && \
chmod +x go-http-proxy-* && sudo mv go-http-proxy-* /usr/local/bin/go-http-proxy
Install it in MacOS
curl -LO https://github.com/abdennour/go-http-proxy/releases/download/v1.0.0/go-http-proxy-darwin-amd64 && \
chmod +x go-http-proxy-* && sudo mv go-http-proxy-* /usr/local/bin/go-http-proxy
Install it in Windows
Download this executable file: https://github.com/abdennour/go-http-proxy/releases/download/v1.0.0/go-http-proxy-windows-amd64.exe
Run it
go-http-proxy
# run it in background by adding "&" at the end of the command
And now the the proxy should be listening on localhost:8080
Run it with custom port
# change default port 8080 to another port (9090)
go-http-proxy --port 9090
Configure your HTTP proxy clients
- Example: Curl behind HTTP proxy ->
curl -x localhost:8080 https://something.com
And now the the proxy should be listening on localhost:9090
- Run the app
go run .
- Validate it
curl -x localhost:8080 https://google.com
or using env varHTTP_PROXY=http://localhost:8080
for other clients
or Run the app with custom port:
or Run it inside container:
MIT