Browse Source

Feature(docker): add tcp options env

pull/133/head
xjasonlyu 3 years ago
parent
commit
289ea82829
  1. 3
      Dockerfile
  2. 12
      docker/entrypoint.sh

3
Dockerfile

@ -22,6 +22,9 @@ ENV PROXY=direct://
ENV MTU=9000
ENV RESTAPI=
ENV UDP_TIMEOUT=
ENV TCP_SNDBUF=
ENV TCP_RCVBUF=
ENV TCP_AUTO_TUNING=
ENV EXTRA_COMMANDS=
ENV TUN_INCLUDED_ROUTES=
ENV TUN_EXCLUDED_ROUTES=

12
docker/entrypoint.sh

@ -69,6 +69,18 @@ run() {
ARGS="$ARGS --udp-timeout $UDP_TIMEOUT"
fi
if [ -n "$TCP_SNDBUF" ]; then
ARGS="$ARGS --tcp-sndbuf $TCP_SNDBUF"
fi
if [ -n "$TCP_RCVBUF" ]; then
ARGS="$ARGS --tcp-rcvbuf $TCP_RCVBUF"
fi
if [ "$TCP_AUTO_TUNING" -eq 1 ]; then
ARGS="$ARGS --tcp-auto-tuning"
fi
exec tun2socks \
--loglevel "$LOGLEVEL" \
--fwmark "$FWMARK" \

Loading…
Cancel
Save