Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
my god i hate batch script
Browse files Browse the repository at this point in the history
  • Loading branch information
mcottontensor committed Feb 28, 2024
1 parent 196b808 commit 178ffc5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
5 changes: 5 additions & 0 deletions SignallingWebServer/platform_scripts/cmd/common.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ set DEFAULT_TURN=0
set START_TURN=0
set SERVER_ARGS=
set FRONTEND_DIR=
set TURN_SERVER=
set TURN_USER=
set TURN_PASS=
set STUN_SERVER=
set PUBLIC_IP=
:arg_loop
IF NOT "%1"=="" (
set HANDLED=0
Expand Down
23 changes: 12 additions & 11 deletions SignallingWebServer/platform_scripts/cmd/start.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ IF "%CONTINUE%"=="1" (
call :SetPublicIP
call :SetupTurnStun bg

set "SERVER_ARGS=%SERVER_ARGS% --serve --https_redirect --public_ip=%PUBLIC_IP%"
IF NOT "%STUN_SERVER%"=="" (
IF NOT "%TURN_SERVER%"=="" (
set PEER_OPTIONS={\\\"iceServers\\\":[{\\\"urls\\\":[\\\"stun:%STUN_SERVER%\\\",\\\"turn:%TURN_SERVER%\\\"],\\\"username\\\":\\\"%TURN_USER%\\\",\\\"credential\\\":\\\"%TURN_PASS%\\\"}]}
set PEER_OPTIONS=
set SERVER_ARGS=!SERVER_ARGS! --serve --https_redirect --public_ip=!PUBLIC_IP!
IF NOT "!STUN_SERVER!"=="" (
IF NOT "!TURN_SERVER!"=="" (
set PEER_OPTIONS={\\\"iceServers\\\":[{\\\"urls\\\":[\\\"stun:!STUN_SERVER!\\\",\\\"turn:!TURN_SERVER!\\\"],\\\"username\\\":\\\"!TURN_USER!\\\",\\\"credential\\\":\\\"!TURN_PASS!\\\"}]}
) ELSE (
set PEER_OPTIONS={\\\"iceServers\\\":[{\\\"urls\\\":[\\\"stun:%STUN_SERVER%\\\"]}]}
set PEER_OPTIONS={\\\"iceServers\\\":[{\\\"urls\\\":[\\\"stun:!STUN_SERVER!\\\"]}]}
)
) ELSE IF NOT "%TURN_SERVER%"=="" (
set PEER_OPTIONS={\\\"iceServers\\\":[{\\\"urls\\\":[\\\"turn:%TURN_SERVER%\\\"],\\\"username\\\":\\\"%TURN_USER%\\\",\\\"credentials\\\":\\\"%TURN_PASS%\\\"}]}
) ELSE IF NOT "!TURN_SERVER!"=="" (
set PEER_OPTIONS={\\\"iceServers\\\":[{\\\"urls\\\":[\\\"turn:!TURN_SERVER!\\\"],\\\"username\\\":\\\"!TURN_USER!\\\",\\\"credentials\\\":\\\"!TURN_PASS!\\\"}]}
)

IF NOT "%PEER_OPTIONS%"=="" (
set SERVER_ARGS=%SERVER_ARGS% --peer_options=\"%PEER_OPTIONS%\"
IF NOT "!PEER_OPTIONS!"=="" (
set SERVER_ARGS=!SERVER_ARGS! --peer_options=\"!PEER_OPTIONS!\"
)
IF NOT "%FRONTEND_DIR%"=="" (
set SERVER_ARGS=%SERVER_ARGS% --http_root=\"%FRONTEND_DIR%\"
IF NOT "!FRONTEND_DIR!"=="" (
set SERVER_ARGS=!SERVER_ARGS! --http_root=\"!FRONTEND_DIR!\"
)

call :PrintConfig
Expand Down

0 comments on commit 178ffc5

Please sign in to comment.