This repository has been archived on 2024-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
wstunnel/entrypoint.sh

18 lines
545 B
Bash
Raw Normal View History

2023-07-01 20:55:17 +03:00
#!/bin/bash
[ -n "$WS_PATH_PREFIX" ] || WS_PATH_PREFIX="$(< /dev/urandom tr -dc 'a-z0-9\-_' | head -c32)"
sed -i /etc/nginx/conf.d/wstunnel.conf -e "s/{{ws_path_prefix}}/$WS_PATH_PREFIX/"
cat << EOF
------------------------------------------------------------------------------
Client connection command:
wstunnel --upgradePathPrefix $WS_PATH_PREFIX -D 1080 ws://$SERVER_HOST:$SERVER_PORT
------------------------------------------------------------------------------
EOF
set -m
nginx -g "daemon off;" &
wstunnel --server ws://0.0.0.0:8080