Implemented keepAlive for WebSocket connection