Based on serjs/socks5-server with modern go features, UDP Associate support, metrics, and more configurability.
Simple socks5 server using go-socks5 with authentication, allowed ips list and destination FQDNs filtering
-
Run docker container using default container port 1080 and expose it to world using host port 1080, with auth creds
docker run -d --name socks5 -p 1080:1080 -e PROXY_USER=<PROXY_USER> -e PROXY_PASSWORD=<PROXY_PASSWORD> serjs/go-socks5-proxy
- Leave
PROXY_USER
andPROXY_PASSWORD
empty for skip authentication options while running socks5 server, see example below
- Leave
-
Run docker container using specifit container port and expose it to host port 1090, without auth creds
docker run -d --name socks5 -p 1090:9090 -e PROXY_PORT=9090 serjs/go-socks5-proxy
ENV variable | Type | Default | Description |
---|---|---|---|
PROXY_USER | String | EMPTY | Set proxy user (also required existed PROXY_PASS) |
PROXY_PASSWORD | String | EMPTY | Set proxy password for auth, used with PROXY_USER |
PROXY_PORT | String | 1080 | Set listen port for application inside docker container |
PROXY_STATUS_PORT | String | unset | Set port for http status page |
PROXY_RESOLVER | String | unset | Set DNS server, defaults to system |
PROXY_RESOLVER_NET | String | ip4 | How to resolve domains |
PROXY_REQUIRE_FQDN | Bool | false | If set, requires fully qualified domain to connect |
PROXY_VERBOSE | bool | false | If set, more verbose logging |
ALLOWED_DEST_FQDN | String | EMPTY | Allowed destination address regular expression pattern. Default allows all. |
ALLOWED_CIDR | []String | Empty | Set allowed CIDR spaces that can connect to proxy, separator , |
docker-compose -f docker-compose.build.yml up -d
Just don't forget to set parameters in the .env
file.
Assuming that you are using container on 1080 host docker port
curl --socks5 <docker host ip>:1080 https://ifcfg.co
- result must show docker host ip (for bridged network)
or
docker run --rm curlimages/curl:7.65.3 -s --socks5 <docker host ip>:1080 https://ifcfg.co
curl --socks5 <docker host ip>:1080 -U <PROXY_USER>:<PROXY_PASSWORD> http://ifcfg.co
or
docker run --rm curlimages/curl:7.65.3 -s --socks5 <PROXY_USER>:<PROXY_PASSWORD>@<docker host ip>:1080 http://ifcfg.co
- Sergey Bogayrets
See also the list of contributors who participated in this project.
MIT