You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- RFC 5389: [Session Traversal Utilities for NAT (STUN)](https://datatracker.ietf.org/doc/html/rfc5389)
11
+
- RFC 5766: [Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)](https://datatracker.ietf.org/doc/html/rfc5766)
12
+
- RFC 6156: [Traversal Using Relays around NAT (TURN) Extension for IPv6](https://datatracker.ietf.org/doc/html/rfc6156#autoid-7)
12
13
13
14
This project is in early stage of development and some of the features described in the RFCs might be missing.
14
15
Expect breaking changes.
@@ -43,7 +44,7 @@ pc = new RTCPeerConnection({
43
44
});
44
45
```
45
46
46
-
## Installation
47
+
## Installation and running
47
48
48
49
1. From source
49
50
@@ -57,77 +58,15 @@ mix run --no-halt
57
58
2. In Docker
58
59
59
60
```console
60
-
docker run ghcr.io/elixir-webrtc/rel:latest
61
+
docker run --network=host ghcr.io/elixir-webrtc/rel:latest
61
62
```
62
63
63
64
## Features and configuration
64
65
65
-
Currently, Rel is configured via environment variables.
Rel by default listens on `0.0.0.0:3478/UDP` for TURN traffic. This can be configured via `LISTEN_IP` and `LISTEN_PORT`.
70
-
71
-
```console
72
-
LISTEN_IP=0.0.0.0
73
-
LISTEN_PORT=3478
74
-
```
75
-
76
-
`EXTERNAL_LISTEN_IP` is the IP address at which Rel is visible to clients. By default, Rel will try to guess the address
77
-
based on active network interfaces, but this must be set explicitly when e.g. using Docker without `--network host`.
78
-
79
-
```console
80
-
EXTERNAL_LISTEN_IP=167.235.241.140
81
-
```
82
-
83
-
By default, Rel will use the same addresses (`RELAY_IP == LISTEN_IP and EXTERNAL_RELAY_IP == EXTERNAL_LISTEN_IP`) to open allocations, but this
84
-
can be set to something else:
85
-
86
-
```console
87
-
RELAY_IP=0.0.0.0
88
-
EXTERNAL_RELAY_IP=167.235.241.140
89
-
```
90
-
91
-
Rel will try to open relay addresses in `49_152 - 65_535` port range, but this can be changed. `RELAY_PORT_END` must be greater than `RELAY_PORT_START`.
92
-
93
-
```console
94
-
RELAY_PORT_START=35000
95
-
RELAY_PORT_END=45000
96
-
```
97
-
98
-
Remember to use the `REALM` variable specific to your deployment. It's used in `REALM` STUN attributes. See
99
-
[this section of RFC 2617](https://datatracker.ietf.org/doc/html/rfc2617#section-3.2.1) to learn about appropriate values for `REALM` attribute.
100
-
101
-
```console
102
-
REALM=my-amazing-turn.com
103
-
```
104
-
105
-
You can configure the number of running `listener` processes. By default, it is equal to number of running Erlang VM schedulers:
106
-
107
-
```console
108
-
LISTENER_COUNT=8
109
-
```
110
-
111
-
### Auth
112
-
113
-
Auth Provider is an HTTP endpoint that provides credentials required by *A REST API For Access To TURN Services*.
114
-
By default it is available at `http://127.0.0.1:4000/`, but the address, encryption and CORS can be configured:
115
-
116
-
```console
117
-
AUTH_IP=127.0.0.1
118
-
AUTH_PORT=4000
119
-
AUTH_USE_TLS=false
120
-
AUTH_KEYFILE=./rel.key
121
-
AUTH_CERTFILE./rel.cert
122
-
AUTH_ALLOW_CORS=false
123
-
```
124
-
125
-
### Metrics
126
-
127
-
By default, Rel provides Prometheus metrics at `http://127.0.0.1:9578/metrics`. The address can be configured:
128
-
129
-
```console
130
-
METRICS_IP=127.0.0.1
131
-
METRICS_PORT=9568
132
-
```
68
+
Rel supports authentication described in [A REST API For Access To TURN Services](https://datatracker.ietf.org/doc/html/draft-uberti-rtcweb-turn-rest-00#section-2.2).
69
+
By default available under `http://127.0.0.1:4000/`. Example request would be `POST http://127.0.0.1:4000/&service=turn&username=johnsmith`.
70
+
Key query parameter currently is not supported.
133
71
72
+
Rel is configured via environment variables. All of the possible options are described in [sample env file](./sample.env).
0 commit comments