NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Senior87 views

Кто инициирует HTTP-запрос на Upgrade при установлении WebSocket-соединения: клиент или сервер?

Practice

AI answer

The client initiates an Upgrade request. For WebSocket, it sends an HTTP request with headers such as Upgrade: websocket and Connection: Upgrade. If the server accepts the request, it responds with 101 Switching Protocols, after which the connection switches to the WebSocket protocol. If the handshake fails, the server can return a regular HTTP error response.