recws icon indicating copy to clipboard operation
recws copied to clipboard

Reconnecting WebSocket is a websocket client based on gorilla/websocket that will automatically reconnect if the connection is dropped and keeps the connection alive - thread safe!

Results 17 recws issues
Sort by recently updated
recently updated
newest added

Currently I do it this way, but find it rather unclean: ```go for { if !ws.IsConnected() { time.Sleep(time.Second * 2) continue } // Do stuff with connection } ``` One...

version: v1.3.1 I am also using ``` &recws.RecConn{ KeepAliveTimeout: 60 * time.Second, } ``` It kept reconnecting after the first connection reset, I also couldn't receive new messages afterwards. ![image](https://user-images.githubusercontent.com/33242068/117559990-7187d680-b0bc-11eb-8c11-5953a9d868fe.png)

Code (from example, but use ws rather than wss) The server is a raw ws nodejs app, working perfectly with a golang client using gorilla websocket. ``` package main import...

https://github.com/recws-org/recws/blob/28f1b9c2e91c3a7a5d5561e6956eac823f7fedf8/recws.go#L289 Seems arbitrary and pointless?

Fix example for more correct read. Current example stops reading on errors, but continue reconnect and always disconnects with keepalive. Fixes https://github.com/recws-org/recws/issues/38

Was playing around with this lib trying to have a fault tolerant ws connection. Tried patches from different prs and forks, still there was a present problem with race -...