forked from EpicGames/PixelStreamingInfrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-start-cirrus.sh
executable file
·31 lines (24 loc) · 1.04 KB
/
docker-start-cirrus.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Copyright Epic Games, Inc. All Rights Reserved.
source turn_user_pwd.sh
USETURN="false"
for arg do
shift
[ "${arg}" = "--with-turn" ] && USETURN="true" && continue
set -- "$@" "${arg}"
done
# Get stun server data for passing to the container
source common_utils.sh
if [ "${USETURN}" = "true" ]; then
set_start_default_values "y" "y" # Both TURN and STUN server defaults
else
set_start_default_values "n" "y" # Only STUN server defaults
fi
use_args "$@"
# Start docker container by name using host networking
if [ "${USETURN}" = "true" ]; then
peerConnectionOptions="{\""iceServers\"":[{\""urls\"":[\""stun:"${stunserver}"\"",\""turn":"${turnserver}\""],\""username\"":\""${turnusername}\"",\""credential\"":\""${turnpassword}\""}]}"
else
peerConnectionOptions="{\""iceServers\"":[{\""urls\"":[\""stun:"${stunserver}"\""]}]}"
fi
docker run --name cirrus_latest --network host --rm --entrypoint /usr/local/bin/node cirrus-webserver /SignallingWebServer/cirrus.js --peerConnectionOptions="${peerConnectionOptions}" --publicIp="${publicip}"