A more robust WebSocket interface.