A proof of concept using multiple WebRTC connections instead of a TURN server.
$ docker build -t video-proxy:latest .
$ docker run -it --rm -e EXTERNAL_IP=10.1.8.175 -p 3478:3478 -p 3478:3478/tcp bprodoehl/turnserver
$ docker run -it --rm -p 80:4000 -p 8200-8202:8200-8202/tcp video-proxy:latest
$ docker run -it --rm -e "NODE_ENV=development" -p 80:4000 -p 8200-8202:8200-8202/tcp -p 9222:9222 -v $(pwd)/src:/www/src video-proxy:latest /www/node_modules/.bin/nodemon --watch src/ --inspect-brk=0.0.0.0:9222 --nolazy src/app.js
or
$ docker run -it --rm -e "NODE_ENV=development" -p 80:4000 -p 8200-8202:8200-8202/tcp -p 9222:9222 -v $(pwd)/src:/www/src video-proxy:latest /www/node_modules/.bin/nodemon --watch src/ --inspect=0.0.0.0:9222 --nolazy src/app.js
The blog post Getting Start with WebRTC contains lots of good information about WebRTC.
- The article starts with a link to a browser based demo (src). This is just one of many samples.
- The section on signaling discusses how to use sockets for signaling.
- The section RTCPeerConnection without servers demonstrates how to avoid signaling altogether.
- The section RTCPeerConnection plus servers discusses the role of STUN and TURN servers and has a link to an article with even more detailed information.
- To test credentials you can use the candidate gathering sample and check if you get a candidate with type relay.
Are there any off the shelf STUN/TURN servers ready for deployment? See orchestrating TURN server deployment and Deploying STUN and TURN servers
-
It would also be possible to run a WebRTC endpoint on a server and construct your own redistribution mechanism (a sample client application is provided by webrtc.org).
-
Since Chrome 31 and Opera 18, a MediaStream from one RTCPeerConnection can be used as the input for another: there's a demo at simpl.info/multi. This can enable more flexible architectures, since it enables a web app to handle call routing by choosing which other peer to connect to.
Instead of a STUN/TURN server have a WebRTC client in the cloud and have each end connect to it. See node-webrtc or mediasoup
- Learning WebRTC peer-to-peer communication, part 2 – connecting 2 browsers on different devices
- Peering Through the WebRTC Fog with SocketPeer
- Google Codelab
- Getting Started with WebRTC
- Canvas streams demp
- express - Fast, unopinionated, minimalist web framework for node.
- http-errors - Create HTTP errors with ease.
- simple-peer - simple WebRTC wrapper
- wrtc - node WebRTC client
- ws - web sockets
- canvas - node canvas support