Signalling server on Different network

I am using y-codemirror and y-webrtc for real time collaborative editor. it worked on the devices using same network but didn’t work for the devices for different network using default y-webrtc signalling server.

As far as I understand it, this is a common problem with WebRTC–it works “peer to peer” 90% of the time but there are some network configurations that do not permit peers to talk to each other, even with a STUN (signalling) server facilitating NAT traversal.

In the video conferencing world, they use an additional TURN server to get around this problem for the remaining 10% of network configurations that can’t simply communicate directly (i.e. after STUN fails).

In Yjs land, you could also set up a y-websocket server to facilitate communication in the cases where direct p2p doesn’t work: the server-sent data will consistently converge with the peer-sent data due to the CRDT algorithms backing Yjs types.

Thank you johnson for you reply.

how to implement custom TURN server like twilo, viagence inside yjs for succesful peer connection to use in real time collaboration like in your textarea example.


I’m afraid I’m not much more help here. I haven’t tried peer-to-peer Yjs yet, and I’m not even sure if a TURN server would work for this purpose. Perhaps others can chime in.