From eafd58d4848616f20708e94b81db32bed39172ea Mon Sep 17 00:00:00 2001 From: Monius Date: Sat, 3 Aug 2024 20:03:54 +0800 Subject: [PATCH] add custom port support --- README.md | 21 ++++++++++++++++++++- entrypoint.sh | 6 +++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3adcd43..42e5383 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,26 @@ The above command will add a little encryption to the existed socks connection, Run, `curl -U "monius:passwd" -x "socks5h://127.0.0.1:9091" -fsSL "https://www.cloudflare.com/cdn-cgi/trace"` to go 🤗 -#### 1.4 🔧 Pre-Configuration Start (advanced) +#### 1.4 🪡 Custom Port(Advanced) + +Run the following commands in your terminal: + +```bash +docker run --privileged --restart=always -itd \ + --name warp_socks_passwd \ + -e NET_PORT=8091 \ + --cap-add NET_ADMIN \ + --cap-add SYS_MODULE \ + --sysctl net.ipv6.conf.all.disable_ipv6=0 \ + --sysctl net.ipv4.conf.all.src_valid_mark=1 \ + -v /lib/modules:/lib/modules \ + -p 8091:8091 \ + monius/docker-warp-socks +``` + +Run, `curl -x "socks5h://127.0.0.1:8091" -fsSL "https://www.cloudflare.com/cdn-cgi/trace"` to go 🤗 + +#### 1.5 🔧 Pre-Configuration Start (advanced) To use your prepared config: diff --git a/entrypoint.sh b/entrypoint.sh index 0c49efd..2584462 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,11 @@ set -e sleep 3 _NET_DEV=warp +_NET_PORT=9091 + NET_DEV="${NET_DEV:-$_NET_DEV}" +NET_PORT="${NET_PORT:-$_NET_PORT}" + _WG_CONF="/etc/wireguard" _IFACE=$(ip route show default | awk '{print $5}') @@ -33,7 +37,7 @@ if [ ! -e "/opt/danted.conf" ]; then cat <