Comment 28 for bug 1227575

Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :

Hi,

In spiceconsole when sending request to websocket server "payload" of websocket is getting converted to javascript ArrayBuffer (https://github.com/metacloud/spice-html5/blob/master/spiceconn.js#L126) and then while converting "message" to arraybuffer connection_id is getting converted to 32 bit integer (https://github.com/metacloud/spice-html5/blob/master/spicemsg.js#L118). This connection_id then gets encrypted (using anding and bit shifting of 32 bit integer) (https://github.com/metacloud/spice-html5/blob/master/spicedataview.js#L84).

At the servers side we get this "message" in recv_frames method of websocket(https://github.com/kanaka/websockify/blob/master/websockify/websocket.py#L337). This message is then decrypted and we get payload in hex format (https://github.com/kanaka/websockify/blob/master/websockify/websocket.py#L348). In this payload first four bytes is connection_id but it is in hex encrypted format.
As data received from client is in hex format, its difficult to retrive the connection_id in user readable format.

To overcome this issue, IMO the sessions need to be managed only in case of NoVncConsole and if the console is SpiceConsole then there is no need to manage the sessions.
For this purpose one flag (is_vnc = true/false) will be passed from novncproxy to determine the console type while creating the server object(websocketproxy.NovaWebSocketProxy).

Please let me know if you found any workaround for the same.