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
Summary
Straight up UDP is impossible in browsers, yet essential for any highly real time applications.
For a real-time game, TCP is unacceptable unless in ideal network conditions (100ms latency 0% packet loss).
There is a protocol called WebRTC meant for p2p connections between browsers. It was designed for things like video/voice chat, file transfer, etc and requires at least a signalling server (STUN) in order to connect peers. The super interesting bit here is that WebRTC allows for the creation of data channels. These channels behave similarly to websockets, and are allowed to be configured to have unordered and unreliable packet delivery.
The protocol has been designed purely for the p2p case and implementing a server/client architecture though it is incredibly awkward (the libs are pretty awkward even for the usecase they were built for).
I think it should be possible to build an api on top of WebRTC libs that would let us create an easy to use UDP-like connection in a client/server model.
HumbleNet: C based lib that works with WebRTC and gets compiled via emscripten
SimplePeer: the best looking lib for radically simplifying WebRTC usage. Also works in Node.js. Currently supports only a single customizable data-channel.
Summary
Straight up UDP is impossible in browsers, yet essential for any highly real time applications.
For a real-time game, TCP is unacceptable unless in ideal network conditions (100ms latency 0% packet loss).
There is a protocol called WebRTC meant for p2p connections between browsers. It was designed for things like video/voice chat, file transfer, etc and requires at least a signalling server (STUN) in order to connect peers. The super interesting bit here is that WebRTC allows for the creation of data channels. These channels behave similarly to websockets, and are allowed to be configured to have unordered and unreliable packet delivery.
The protocol has been designed purely for the p2p case and implementing a server/client architecture though it is incredibly awkward (the libs are pretty awkward even for the usecase they were built for).
I think it should be possible to build an api on top of WebRTC libs that would let us create an easy to use UDP-like connection in a client/server model.
Background Reading
The text was updated successfully, but these errors were encountered: