Кто инициирует HTTP-запрос на Upgrade при установлении WebSocket-соединения: клиент или сервер?
Asked at
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.
Also asked at getmatch agency
- Why did you leave your previous job?
- What types of data are there in Python?
- Tell us about your work experience.
- A user uploads a video and selects the desired processing, which he wants to get. The service accepts the video, applies the necessary processing, and outputs the final result. By processing, we can understand, for example, the following: make the video black and white, flip it, speed it up N times, etc. It is important that the user can monitor the progress of the processing. Load: 10,000 videos per minute
- What frameworks have you worked with?
Similar questions
- Could you explain what CORS is and how it works?
- What protocols are used when establishing a WebSocket connection?
- How to open a WebSocket connection?
- What is HTTP, and which layers of the OSI model do we typically work with as backend developers?
- In simple terms, how does the “S” in HTTPS work? What kind of encryption is used there—symmetric or asymmetric?