joewalnes / reconnecting-websocket

A small decorator for the JavaScript WebSocket API that automatically reconnects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sending a message upon reconnect

stefan-reich opened this issue · comments

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.

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

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