tags : Web Development, Network Programming, Web Security, NAT

FAQ

Web socket, Web RTC, SSE, what?

  • Videoconferencing or real-time messaging that doesn’t need a central source of truth: WebRTC
  • Real-time collaboration with the need of a central source of truth and a small number of clients: Websockets
  • Notification system that can stay quiet for a long time: Server-Sent Events, but beware of scaling the number of clients
  • Anything else, like refreshing some components data, or a notification system with a big number of clients: polling

WebRTC & WebTorrent (See Bittorrent)

Webtorrent

Use a free signalling server from the webtorrent community. You can skip the torrent part of the implementation and just use the signalling, it’s awesome. You can use a libraries like:

https://github.com/webtorrent/bittorrent-tracker

https://github.com/subins2000/p2pt

to get started. For me, I found the protocol is simple enough where I just use small vanilla javascipt implementation to talk to the websocket servers to generate the signalling messages. I wish more people knew about this and realize how easy it can be to bring WebRTC to their applications.

List of some free webtorrent trackers:

wss://tracker.openwebtorrent.com wss://tracker.files.fm:7073 wss://tracker.webtorrent.dev

---> Usage stats for the last one: https://tracker.webtorrent.dev

Some free stun servers for NAT traversal:

stun:stun.cloudflare.com stun:stun.l.google.com:19302

Basic stuff

Tools

Others

STUN/TURN and ICE

pion

Others

Bigger projects built on WebRTC

[[https://mediasoup.org/documentation/overview/][mediasoup : Overview]] : Cutting Edge WebRTC Video Conferencing

peer-calls/peer-calls

WebRTC support being added to FFmpeg | Hacker News

OBS merges WebRTC support | Hacker News