From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgzO1-00076H-HC for qemu-devel@nongnu.org; Fri, 07 Dec 2012 09:58:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgzNv-0004Qv-MI for qemu-devel@nongnu.org; Fri, 07 Dec 2012 09:58:45 -0500 Received: from cantor2.suse.de ([195.135.220.15]:58436 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgzNv-0004O9-CX for qemu-devel@nongnu.org; Fri, 07 Dec 2012 09:58:39 -0500 From: Tim Hardeck Date: Fri, 7 Dec 2012 15:56:32 +0100 Message-Id: <1354892195-18332-1-git-send-email-thardeck@suse.de> Subject: [Qemu-devel] [PATCH 0/3 v4] vnc: added initial websocket protocol support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, stefanha@gmail.com, github@martintribe.org, Tim Hardeck , alevy@redhat.com, kraxel@redhat.com, corentin.chary@gmail.com This patch set adds basic Websocket Protocol version 13 - RFC 6455 - support to QEMU VNC. Binary encoding support on the client side is mandatory. Because of the GnuTLS requirement the Websockets implementation is optional (--enable-vnc-ws). To activate Websocket support the VNC option "websocket"is used, for example "-vnc :0,websocket". The listen port for Websocket connections is (5700 + display) so if QEMU VNC is started with :0 the Websocket port would be 5700. As an alternative the Websocket port could be manually specified by using ",websocket=" instead. Changes v2 * removed automatic websocket recognition * added new lwebsock socket on port 5700 + display when the vnc option "websocket" is passed on * adapted vnc_connect vnc_listen_read to differ between websocket * added separate event handler to read the Websocket handshake Changes v3 * added manual port specification by using ",websocket=" * switched from memmem() to g_strstr_len() * removed masked_size from vncws_decode_frame() * resetted vnc_tls variable to default in the configure script Changes v4 * incorporated suggestions from Stefan Hajnoczi * moved websockets encoding from vnc_write to its own client_write function * moved websockets decoding to its own client_read function * added initialization checks to vnc_disconnect to prevent crashes if a regular client connects to the websocket port Tim Hardeck (3): vnc: added buffer_advance function vnc: added initial websocket protocol support vnc: fix possible uninitialized removals configure | 27 +++++- qemu-options.hx | 8 ++ ui/Makefile.objs | 1 + ui/vnc-ws.c | 282 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ ui/vnc-ws.h | 92 ++++++++++++++++++ ui/vnc.c | 223 ++++++++++++++++++++++++++++++++++++------ ui/vnc.h | 20 ++++ 7 files changed, 620 insertions(+), 33 deletions(-) create mode 100644 ui/vnc-ws.c create mode 100644 ui/vnc-ws.h -- 1.7.10.4