18 lines
545 B
Bash
18 lines
545 B
Bash
#!/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
|