/video-proxy

A proof of concept using multiple WebRTC connections instead of a TURN server.

Primary LanguageJavaScriptMIT LicenseMIT

video-proxy

A proof of concept using multiple WebRTC connections instead of a TURN server.

Build

$ docker build -t video-proxy:latest .

Run

$ 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

Debug

$ 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

Overview

The blog post Getting Start with WebRTC contains lots of good information about WebRTC.

Idea

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.

Idea

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

More Notes

Dependencies

  • 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