Skip to content

Commit

Permalink
linagora/lgs/openpaas/hublin#598 Fix ICE related configuration for Janus
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Hamerling committed Feb 5, 2018
1 parent 87289bb commit 1f68910
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ RUN apt-get install nginx -y
COPY nginx/nginx.conf /etc/nginx/nginx.conf

EXPOSE 80 7088 8088 8188 8089
EXPOSE 10000-10200/udp

CMD service nginx restart && /opt/janus/bin/janus
CMD service nginx restart && /opt/janus/bin/janus --nat-1-1=${DOCKER_IP}
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,25 @@ $ docker build -t linagora/janus-gateway .
Run the container

```shell
$ docker run -p 80:80 -p 7088:7088 -p 8088:8088 -p 8188:8188 linagora/janus-gateway
$ DOCKER_IP=<THE IP OF YOUR DOCKER> docker run -p 80:80 -p 7088:7088 -p 8088:8088 -p 8188:8188 -p 10000-10200:10000-10200/udp linagora/janus-gateway
```

Where `DOCKER_IP` is the public IP address where Docker services can be reached. This will be used by Janus to send back the right IP to Web clients (ICE candidates) so that they can communicate with Janus correctly.

That's it!

Details:

To make this even easier, copy `docker-compose.yml` [from this repo](https://github.com/linagora/docker-janus-gateway/blob/master/docker-compose.yml). Then you'll only need to:

```shell
$ docker-compose up
$ DOCKER_IP=<YOUR DOCKER IP> docker-compose up
```

Where ports:
- **80**: expose janus documentation and admin/monitoring website
- **7088**: expose Admin/monitor server
- **8088**: expose Janus server
- **8188**: expose Websocket server
- **10000-10200/udp**: Used during session establishment

8 changes: 4 additions & 4 deletions conf/janus.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ cert_key = /opt/janus/share/janus/certs/mycert.key
[media]
;ipv6 = true
;max_nack_queue = 500
;rtp_port_range = 20000-40000
rtp_port_range = 10000-10200
;dtls_mtu = 1200
;force-bundle = true
;force-rtcp-mux = true
Expand All @@ -97,10 +97,10 @@ cert_key = /opt/janus/share/janus/certs/mycert.key
; you can also enable ICE-TCP support (beware that it currently *only*
; works if you enable ICE Lite as well), choose which interfaces should
; be used for gathering candidates, and enable or disable the
; internal libnice debugging, if needed.
; internal libnice debugging, if needed.
[nat]
;stun_server = stun.voip.eutelia.it
;stun_port = 3478
stun_server = stun.l.google.com
stun_port = 19302
nice_debug = false
;ice_lite = true
;ice_tcp = true
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ services:
- "7088:7088"
- "8088:8088"
- "8188:8188"
- "8089:8089"
- "8089:8089"
- "10000-10200:10000-10200/udp"
environment:
- DOCKER_IP=${DOCKER_IP}

0 comments on commit 1f68910

Please sign in to comment.