LibVNC / libvncserver

LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
GNU General Public License v2.0
1.07k stars 481 forks source link

Fix ws binary/base64 subprotocol priority #595

Open VelorumS opened 8 months ago

VelorumS commented 8 months ago

The problem is when the client advertises "protocol": ["binary", "base64"], the server picks base64. The server should prefer the first one.

It's an issue when the client had this configuration as a fix to the 400 Client must support 'binary' or 'base64' protocol error with noVNC and old websockify + VNC: https://github.com/novnc/noVNC/issues/1276#issuecomment-564677833 . Today it seems that noVNC doesn't do base64 any more. Although it's now incorrect for the client to advertise both protocols, it's not intuitive that "protocol": ["binary", "base64"] doesn't work while "protocol": ["binary"] does.

Relevant PR/issue:

https://github.com/LibVNC/libvncserver/pull/342

https://github.com/novnc/noVNC/issues/1310