A proxy server written on golang
git clone https://github.com/prakashpandey/goxy
-
host
: Host of proxy server -
port
: The port you want your proxy server to run at -
authorize
:true/false
based on if you want to use an authenticated proxy server or not -
user
: Username of proxy server. Valid only ifauthorize
is settrue
-
password
: Password of proxy server. Valid only ifauthorize
is settrue
-
proto
: define protocol("http/https") -
cert
: proxy server certificate file name. Valid only ifproto
is set tohttps
-
key
: proxy server private-key file name. Valid only ifproto
is set tohttps
-
cd github.com/prakashpandey/goxy
-
go build
-
Run proxy server in http mode(with authorization true):
./goxy -host="localhost" -port=9090 -authorize=true -user="root" -password="pass" -proto="http"
- Run proxy server in https mode(with authorization true):
./goxy -host="localhost" -port=9090 -authorize=true -user="root" -password="pass" -proto="https" -cert="cert.pem" -key="key.pem"
- Install
openssl
if not already install, then run the below commands to generatecerttificate
andprivate key
for your server.
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem
- Curl command for get http url. Remove
proxyUser:proxyPassword
ifauthorize
is set tofalse
curl -U proxyUser:proxyPassword --proxy http://localhost:9090 http://google.com
- Curl command for https request. Remove
proxyUser:proxyPassword
ifauthorize
is set tofalse
curl -Lv -U proxyUser:proxyPassword --proxy https://localhost:9090 --proxy-cacert cert.pem https://google.com