JavaScript websocket client for real-time connections