Skip to content

Commit

Permalink
Update docker commands to utilize coturn properly (#134)
Browse files Browse the repository at this point in the history
* set the env variable of turn host in docker example

As the coturn is embedded into the selkies desktop, the host address is required for
the client in order to utilize coturn server.

* update coturn docker commands to pass realm argument

The realm argument is necessay for the coturn in order to support TURN capability

---------

Co-authored-by: Seungmin Kim <8457324+ehfd@users.noreply.github.com>
  • Loading branch information
PMohanJ and ehfd committed Feb 2, 2024
1 parent 6f7c17e commit 29bdfad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.example
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ sudo /usr/bin/pulseaudio --daemonize --system --verbose --log-target=file:/tmp/p
sudo /start-turnserver.sh &\n\
export WEBRTC_ENCODER=\${WEBRTC_ENCODER:-x264enc}\n\
export WEBRTC_ENABLE_RESIZE=\${WEBRTC_ENABLE_RESIZE:-true}\n\
export TURN_HOST=\${TURN_HOST:-localhost}\n\
export TURN_HOST=\${TURN_HOST:-$(curl checkip.amazonaws.com)}\n\
export TURN_PORT=\${TURN_PORT:-3478}\n\
export TURN_USERNAME=\${TURN_USERNAME:-selkies}\n\
export TURN_PASSWORD=\${TURN_PASSWORD:-selkies}\n\
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,13 @@ In order to deploy a coTURN container, use the following command (consult this [
For time-limited shared secret TURN authentication:

```
docker run -d -p 3478:3478 -p 3478:3478/udp -p 49160-49200:49160-49200/udp coturn/coturn -n --min-port=49160 --max-port=49200 --use-auth-secret --static-auth-secret=(PUT RANDOM 64 BYTE BASE64 KEY HERE)
docker run -d -p 3478:3478 -p 3478:3478/udp -p 49160-49200:49160-49200/udp coturn/coturn -n --realm=example.com --min-port=49160 --max-port=49200 --use-auth-secret --static-auth-secret=(PUT RANDOM 64 BYTE BASE64 KEY HERE)
```

For legacy long-term TURN authentication:

```
docker run -d -p 3478:3478 -p 3478:3478/udp -p 49160-49200:49160-49200/udp coturn/coturn -n --min-port=49160 --max-port=49200 --lt-cred-mech --user=yourusername:yourpassword
docker run -d -p 3478:3478 -p 3478:3478/udp -p 49160-49200:49160-49200/udp coturn/coturn -n --realm=example.com --min-port=49160 --max-port=49200 --lt-cred-mech --user=yourusername:yourpassword
```

If you want to use TURN over TLS/DTLS, you must have a valid hostname, and also provision a valid certificate issued from a legitimate certificate authority such as [ZeroSSL](https://zerossl.com/features/acme/) (Let's Encrypt may have issues depending on the OS), and provide the certificate and private files to the coTURN container with `-v /mylocalpath/coturncert.pem:/etc/coturncert.pem -v /mylocalpath/coturnkey.pem:/etc/coturnkey.pem`, then add the command-line arguments `-n --cert=/etc/coturncert.pem --pkey=/etc/coturnkey.pem` (the specified paths are an example).
Expand Down Expand Up @@ -396,7 +396,7 @@ However, it might be that the parameters for the WebRTC interface, video encoder

### The HTML5 web interface loads and the signalling connection works, but the WebRTC connection fails and the remote desktop does not start.

Please read [Using a TURN server](#using-a-turn-server). Make sure to also check that you enabled automatic login with your display manager, as the remote desktop cannot access the initial login screen after boot without login.
Please read [Using a TURN server](#using-a-turn-server). Make sure to also check that you enabled automatic login with your display manager, as the remote desktop cannot access the initial login screen after boot without login. If you created the TURN server or the example container inside a VPN-enabled environment or virtual machine and the WebRTC connection fails, then you may need to add the `TURN_HOST` environment variable to the VPN private IP of the TURN server host, such as `192.168.0.105`.

### I want to pass multiple screens within a server to another client using the WebRTC HTML5 web interface.

Expand Down

0 comments on commit 29bdfad

Please sign in to comment.