WebSockets in Python3.1 Handshake Issue

I am using python3.1, so I found here a websocket html5 fragment:

http://www.nublue.co.uk/blog/threaded-python-websocket-server-and-javascript-client/

I'm testing chrome.

After sending the confirmation packet, the web client does not have a response as expected (websocket.onopen is not running). I get a customer request. .i tried many times. It just doesn't work.


Here is the .NET code:

http://nugget.codeplex.com/

I am testing it, it works great. My chrome is fine. I want to know if there is any python3.x demo code that can help me.

And my car: WIN7 pro X86

thanks.

0
source share
2 answers

The noVNC project (VNC HTML5 client) contains python 2.X (but it’s easy to convert to 3.X) with the name wsproxy , which is WebSockets for a common TCP proxy server. It transparently supports v75 and v76 (which has a new handshake) of the WebSockets protocol.

If you are still working on this, this might be a useful link, at least.

Disclaimer: I made noVNC and wsproxy.

+1
source

oh.i got it.

This article is out of date.

and look:

http://en.wikipedia.org/wiki/Web_Sockets

the sum of the concatenated string. [1]

the sum of the concatenated string. [1]> Sec-WebSocket-Key1 and

Sec-WebSocket-Key2 and 8 bytes after random token fields that the server uses to build a 16-byte token at the end of his handshake to prove that he read the client handshake. a handshake constructed by concatenating numbers from the first key and dividing by the number of spaces. Then this is repeated for the second key. These two result numbers are combined with each other, and with the last 8 bytes after the field. The end result is the MD5 sum of the concatenated string. [1] the sum of the concatenated string. [1]

the sum of the concatenated string. [1]

0
source

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


All Articles