Added reconnection for websockets.