Closed asalem1 closed 2 years ago
@dmonad any thoughts on this? I'd love to make some headway on this but would wanna wait for your thoughts on how to go about it
Closing this, ended up resolving the issue by having the server send a specific auth code to listen for on the client. On the client, the y-websocket instance was listening for connection-close
, where the code is returned and can just trigger a disconnect
This is related to the thread here:
https://github.com/yjs/y-websocket/issues/7
Is your feature request related to a problem? Please describe. Currently emitting a message to trigger the message handler for unauthenticated requests continues reconnect attempts, despite getting console.warns according to the authProtocols here:
https://github.com/yjs/y-websocket/blob/master/src/y-websocket.js#L52-L54
Describe the solution you'd like As far as I can tell, there are two ways the API can stop reconnect attempts from the API:
onclose
function on the websocket provider as suggested by the comment hereDescribe alternatives you've considered An alternative might be to export the messageHandlers so that the user has more control on websocket connections handle them on an as needed basis
Additional context Unless I'm missing something, it seems like the websocket will continuously try to connect to the API despite receiving the unauthenticated request