Go to file
Sergey Bogatyrets c30bfd3d72
Merge pull request #48 from serjs/dependabot/go_modules/golang.org/x/net-0.17.0
Bump golang.org/x/net from 0.1.0 to 0.17.0
2024-02-26 07:09:16 +03:00
.github Rewrite CI logic with metadata-action and build-push-action 2023-03-13 02:06:25 +03:00
vendor Bump golang.org/x/net from 0.1.0 to 0.17.0 2023-10-11 22:23:38 +00:00
.env add docker-compose and .env files 2018-12-16 12:19:24 +01:00
Changelog.md Update unrealsead changes 2023-03-12 20:31:43 +03:00
docker-compose.build.yml Added allowed IPs support 2023-03-06 00:48:21 +03:00
docker-compose.yml add docker-compose and .env files 2018-12-16 12:19:24 +01:00
Dockerfile Update to the latest dependency versions and use distroless/static:nonroot image 2022-11-03 08:04:20 +00:00
Dockerfile.armv6 Dockerfile.armv6 typos 2022-11-08 14:55:20 +03:00
go.mod Bump golang.org/x/net from 0.1.0 to 0.17.0 2023-10-11 22:23:38 +00:00
go.sum Bump golang.org/x/net from 0.1.0 to 0.17.0 2023-10-11 22:23:38 +00:00
README.md Update Readme 2023-03-13 01:21:47 +03:00
ruleset.go Added Regex destination matching 2021-07-24 21:22:03 +10:00
server.go Merge branch 'master' into restrict-dest 2023-03-12 20:21:08 +03:00

go-socks5-proxy

Latest tag from master branch Release tag

Simple socks5 server using go-socks5 with authentication, allowed ips list and destination FQDNs filtering

Examples

  • 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 and PROXY_PASSWORD empty for skip authentication options while running socks5 server, see example below
  • 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

List of supported config parameters

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
ALLOWED_DEST_FQDN String EMPTY Allowed destination address regular expression pattern. Default allows all.
ALLOWED_IPS String Empty Set allowed IP's that can connect to proxy, separator ,

Build your own image:

docker-compose -f docker-compose.build.yml up -d
Just don't forget to set parameters in the .env file.

Test running service

Assuming that you are using container on 1080 host docker port

Without authentication

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

With authentication

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

Authors

  • Sergey Bogayrets

See also the list of contributors who participated in this project.