reconnecting websocket with timeout