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.
source share