Implementing WebSocket (in middle)