How can websockets be faster than a simple HTTP request?

You still need to send requests from your computer to the website server and back. How do websockets do this much faster?

+4
source share
1 answer

WebSocket is an extension for HTTP. For weak communications, web sockets are better.

Also check out this article

How can web sites do this much faster?

To establish a WebSocket connection, update the client and server from the HTTP protocol to the WebSocket protocol during their initial confirmation, as shown in the following example: -

GET /text HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: www.websocket.org

HTTP/1.1 101 WebSocket Protocol Handshake
Upgrade: WebSocket
Connection: Upgrade

WebSocket . . . 0x00, 0xFF UTF-8 . WebSocket , .

Web Sockets - - a , , . - HTML5 , . , , , . Web Sockets .

: -

enter image description here

: -

Web Sockets . , HTML5 Web Sockets 500: 1 - HTTP- - 1000: 1 HTTP- 3: 1 . ; - !

+12

All Articles