handle WebSocket push and pull