Fix socket to wait for data after WebSocket upgrade