From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alex Braunegg" Subject: [PATCH] libxl/libxl_dm.c: Enable websocket functionality Date: Thu, 4 Feb 2016 08:50:22 +1100 Message-ID: <56b27623.954b620a.b9ec7.ffff96d4@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Language: en-au List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi all, I have been testing the Xen 4.6.0 packages - however there is no way that I have found to enable websocket support in any of the xen / qemu configuration files. The only way that I have been able to do this is with the following patch - which works perfectly for my use case on a CentOS 6.x derived system: ------------------------------------- diff -uNr xen-4.6.0.original/tools/libxl/libxl_dm.c xen-4.6.0.modified/tools/libxl/libxl_dm.c --- xen-4.6.0.original/tools/libxl/libxl_dm.c 2015-10-06 01:33:39.000000000 +1100 +++ xen-4.6.0.modified/tools/libxl/libxl_dm.c 2016-01-29 08:50:18.860371704 +1100 @@ -440,11 +440,11 @@ } vncarg = vnc->listen; } else { - vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen, + vncarg = libxl__sprintf(gc, "%s:%d,websocket,x509=/etc/pki/xen", vnc->listen, vnc->display); } } else - vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display); + vncarg = libxl__sprintf(gc, "127.0.0.1:%d,websocket,x509=/etc/pki/xen", vnc->display); if (vnc->passwd && vnc->passwd[0]) { vncarg = libxl__sprintf(gc, "%s,password", vncarg); @@ -806,11 +806,11 @@ } vncarg = vnc->listen; } else { - vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen, + vncarg = libxl__sprintf(gc, "%s:%d,websocket,x509=/etc/pki/xen", vnc->listen, vnc->display); } } else - vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display); + vncarg = libxl__sprintf(gc, "127.0.0.1:%d,websocket,x509=/etc/pki/xen", vnc->display); if (vnc->passwd && vnc->passwd[0]) { vncarg = libxl__sprintf(gc, "%s,password", vncarg); ------------------------------------- This however introduces 2 hard-coded items: - Websocket will be enabled each time VNC is enabled. - x509 certificate path By default, the websocket port mirrors the vnc port = so vnc port = 5900, then websocket port = 5700 and so on. A better solution however in my mind would be to store the websocket & x509 path in the .cfg file for each virtual machine: ------------------------------------- vnc=1 vncconsole=1 vnclisten='0.0.0.0' vncpasswd='abcd1234' vncdisplay=0 websocket=1 <- where 0 = disabled, 1 = enabled x509={path} <- File system path to x509 files to cater for OS system variance or user preference, would also allow for different certificates per websocket connection if required ------------------------------------- Best regards, Alex