modulepackage
0.0.0-20240120234945-6db48bc86b53
Repository: https://github.com/aventer-ug/go-proxy.git
Documentation: pkg.go.dev
# README
go-proxy
This is a proxy written in go.
There are some environment variables to configure go-proxy.
- API_PROXYBIND = Thats the IP of the interface where the proxy should listening. Default value is "0.0.0.0".
- API_PROXYPORT = Thats the Port where the proxy is listening. Default value is 10777.
- TARGET_URL = Thats the URL to where all the requests will be forwarded. No default value.
- SKIP_SSL = Do not check the ssl certificate of the target url. Default value is false.
- BLOCK_USERAGENT = With these variable, it is possible to block UserAgents. No default value.
- BLOCK_URL = Same like BLOCK_USERAGENT. Only for the URL String included GET parameters. No default value.
- LOGLEVEL = The loglevel of the output. Default value "info".
How to run
docker run -e TARGET_URL=https:// -p 10777:10777 avhost/go-proxy:latest
How to Block UserAgents
To block Bots and Spam who does not respect robots.txt, it is possible to defined and list with UserAgend should be blocked. As example:
BLOCK_USERAGENT="(Bot|The World)"
This will block all UserAgents with the string "Bot" or "The World".
How to Block URL's
To block whole URL's, you can use regular expression to create a filter.
BLOCK_USERAGENT="(arg=1|private)"
This will block every access to the URL with the GET parameter "arg=1" or the string "private".
# Variables
APIProxyBind is the IP where the service are listening.
APIProxyPort is the Port where the service are listening.
BlockAgent include a regularexpression to denied access of specified user agents.
BlockURL include a regularexpression to denied access of specified url.
LogLevel defines the loglevel.
MinVersion is just the version of this app, its set dynamic during compiling.
SkipSSL will disable the ssl check.
TargetURL is the Url to where the proxy will forward all access.