yjs / y-webrtc

WebRTC Connector for Yjs
MIT License
448 stars 109 forks source link

Add custom signaling implementation support #37

Closed msurdi closed 2 years ago

msurdi commented 2 years ago

Hi team!

I'm working on an experiment where we need to use an existing WebSocket service. This existing service has some custom authentication and messaging semantics which do not match the ones from SignalingConn.

This pull request is a small refactor (seems like a lot of code, but it is mostly just moving things around) so that now we can pass a signalingConn parameter to the WebrtcProvider constructor, kind of similar to what's being done on y-websocket with the WebSocketPolyfill.

@dmonad and other maintainers, I'd really appreciate your opinions on this.

Is there any better way to do this that I missed? Do you think this is something we could include in this library? I'm very happy and open to any feedback you might have on these changes if so, from naming to how to expose this functionality just let me know and i'll update it.

Thanks a lot for making this great tool available to everyone 🏆 .