What version of the websockets protocol protocol does the Google Chrome application make

I am trying to implement a websockets server in java, but I am having trouble understanding that the websocket protocol version is running google chrome. In this blog post, the Chromium team mentions that they have implemented version 76 of the websockets protocol, which should have the following confirmation request (copied from the official version 76 of spec (section 1.2)):

GET /demo HTTP/1.1
Host: example.com
Connection: Upgrade
Sec-WebSocket-Key2: 12998 5 Y3 1  .P00
Sec-WebSocket-Protocol: sample
Upgrade: WebSocket
Sec-WebSocket-Key1: 4 @1  46546xW%0l 1 5
Origin: http://example.com

^n:ds[4U

where as a confirmation message that I get from google chrome (8.0.552.237) is:

GET / HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: localhost:8082
Origin: http://localhost:8081
Sec-WebSocket-Key1: g3 I 9w F :  Kt  3?u784C-0 99  5z
Sec-WebSocket-Key2: 4    S5l&Y4m]11+4 032s Ecfl

ïÿÁëƒ^

Can someone explain to me why there is a mismatch between the googles version and the official specification. And what will be the correct response format for the Google version.

PS: - , websockets?

+3
1

Chrome draft-hixie-thewebsocketprotocol-76, draft-ietf-hybi-thewebsocketprotocol-03. IETF HyBi, 03 , ( v76).

, Chrome-8.0.552, . , , , , , , Javascript , URL- .

( , ):

HTTP/1.1 101 WebSocket Protocol Handshake
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Origin: http://example.com
Sec-WebSocket-Location: ws://example.com/demo
Sec-WebSocket-Protocol: sample

8jKS'y:G*Co,Wxa-

HyBi, , . , (04) , . A (05), , . , 04 ( ). 05, , , .

, , API- WebSockets, , .

+4

Source: https://habr.com/ru/post/1789573/


All Articles