Skip to content

vnc: added initial websocket protocol support

Tim Hardeck qemu-devel 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest3 patches 0 repliesNew
  2. v63 patches 1 replySuperseded
  3. v53 patches 7 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v43 patches3 repliesSuperseded
v31 patch2 repliesSuperseded

Changes in v7 from the cover letter

* fixed vnc-ws header define

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3vnc: added buffer_advance functionui/vnc.c ui/vnc.h+10 -40 replies
2/3vnc: added initial websocket protocol supportconfigure qemu-options.hx ui/Makefile.objs +4 more+591 -210 replies
3/3vnc: fix possible uninitialized removalsui/vnc.c ui/vnc.h+9 -30 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchAnthony Liguori
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [Qemu-devel] [PATCH 0/3 v7] vnc: added initial websocket protocol support

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=<port>" 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=<port>"
* 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

Changes v5
* added initialized variable to VncState to prevent crashes during vnc_disconnect - the previously added initialization checks didn't prevent segfaults when a websocket client was connected

Changes v6
* incorporated suggestions from "Blue Swirl"
* updated vncws_handshake_read to check for the header end tag and to not reset the buffer afterwards

Changes v7
* fixed vnc-ws header define

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      |  284 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ui/vnc-ws.h      |   86 +++++++++++++++++
 ui/vnc.c         |  211 +++++++++++++++++++++++++++++++++++-----
 ui/vnc.h         |   21 ++++
 7 files changed, 610 insertions(+), 28 deletions(-)
 create mode 100644 ui/vnc-ws.c
 create mode 100644 ui/vnc-ws.h

--
1.7.10.4