fix: force OBFUSCATOR_PORT from OBFUSCATOR_PORTS[0] (override lib-core 51821 default)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Андрей Бобырев
2026-05-31 13:56:01 +03:00
parent 6ec1782d8b
commit 51712310f6

View File

@@ -7,9 +7,10 @@ load_env
ensure_dirs ensure_dirs
# server.env stores OBFUSCATOR_PORTS (plural, comma list). Client obfuscator # server.env stores OBFUSCATOR_PORTS (plural, comma list). Client obfuscator
# must target an ACTUAL listening port — derive single port from the first one. # must target an ACTUAL listening port. lib-core load_env defaults OBFUSCATOR_PORT
# (Bug: default 51821 was never listened on -> client handshake failed.) # to 51821 (NOT listened on) -> handshake failed. Override unconditionally from
OBFUSCATOR_PORT="${OBFUSCATOR_PORT:-$(echo "${OBFUSCATOR_PORTS:-51821}" | cut -d',' -f1)}" # the real port list when present.
[ -n "${OBFUSCATOR_PORTS:-}" ] && export OBFUSCATOR_PORT="$(echo "$OBFUSCATOR_PORTS" | cut -d',' -f1)"
CMD="${1:-help}" CMD="${1:-help}"
CLIENT_ARG="${2:-}" CLIENT_ARG="${2:-}"