Search code examples
browserwebrtcmicrosoft-edgecommunication

Local browser to browser communication with web RTC


I'm looking at options for two browsers to communicte to each other on the same machine. We've currently got a system where a browser based app opens another browser based app passing URL params and then later closes the launched browser window. However in EDGE Chorium browser app 1 can no longer shut browser app 2 down so we end-up with a ton of open windows.

It's OK for the second browser app to remain open if it can be re-used for subsequent messages.

We've been looking at options for local comms between the two browsers. We want to avoid comms via the server (e.g. web socket) as it gets complicated. I'm wondering if webRTC can help? I know webRTC typically uses a server to establish the connection but if its just browsers local to the same machine is there a way around this? I've read RTC uses UDP and hence message delivery is not guaranteed, we really need reliable delivery. But I've seen other stuff suggesting web RTC can switch to other slower but more reliable protocols?


Solution

  • I know webRTC typically uses a server to establish the connection but if its just browsers local to the same machine is there a way around this?

    Unfortunately WebRTC requires a signaling server today. But there is an effort to fix this [Idea] Local devices API (LAN services)

    I've read RTC uses UDP and hence message delivery is not guaranteed, we really need reliable delivery.

    If you are sending binary/text you will use DataChannels. DataChannels by default is reliable, even when running over UDP. DataChannels uses SCTP, which is ACK based so you don't need to worry about data loss.

    If you are sending media WebRTC uses RTP. RTP provides lots of tools to ensure reliable delivery. However for media data it doesn't make sense to fix something that happened in the past. By design it will not block the call and fall behind.