vanilla websocket implementation