Search code examples
javascriptnetwork-programmingbrowserwebrtcp2p

Is there a way to connect two browsers without WebRTC?


I want to create a Peer to Peer connection with two browsers without using existing code (mostly). I want to implement the server infrastructure by myself, as well as the client code.

There is just one issue, WebRTC seems to be everywhere. Don't get me wrong, I'd use it, but since this is for a school project I have to implement almost everything by myself.

Looking at the WebRTC source code, I expected some Javascript implementations of existing components, however, all I ended up seeing is very complex C++ code that is intended for web browser developers.

Is it possible to implement a Peer to Peer connection between two browsers without using WebRTC?


Solution

  • For security reasons browsers do not allow you to make UDP and TCP requests yourself. You need to use one of the 3 protocols provided by browsers

    • HTTP
    • WebSockets
    • WebRTC

    The C++ code you saw is the underlying implementation that browsers can use for WebRTC