joewalnes / reconnecting-websocket

A small decorator for the JavaScript WebSocket API that automatically reconnects
MIT License
4.21k stars 970 forks source link

Sending a message upon reconnect #91

Closed stefan-reich closed 4 years ago

stefan-reich commented 6 years ago

I'm surprised no one has asked for this. I need the ReconnectingWebSocket to send a message to the server when it reconnects, so the server knows what to stream.

Edit: Ah, I think I don't even need this. The ReconnectingWebSocket API sends me an onOpen event upon reconnect. And in the onOpen method, I send the necessary streaming command to the server anyway. It just works as advertised. You can test here if you like.

stefan-reich commented 6 years ago

I'm leaving it open for a bit for people to peruse

nttoan26 commented 4 years ago

2 years are more than 'a bit', close it man