Client-side WebSocket API