On 01/05/2017 10:06 AM, Daniel P. Berrange wrote: > The code which interprets the CLI args to populate the SocketAddress > objects for plain & websockets VNC is quite complex already and will > need further enhancements shortly. Refactor it into separate methods > to avoid vnc_display_open getting even larger. As a side effect of > the refactoring, it is now possible to specify a listen address for > the websocket server explicitly. e.g, > > -vnc localhost:5900,websockets=0.0.0.0:8080 > > will listen on localhost for the plain VNC server, but expose the > websockets VNC server on the public interface. This refactoring > also removes the restriction that prevents enabling websockets > when the plain VNC server is listening on a UNIX socket. > > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> > --- > qemu-options.hx | 12 ++- > ui/vnc.c | 282 > ++++++++++++++++++++++++++++++++++++-------------------- > 2 files changed, 189 insertions(+), 105 deletions(-) > > diff --git a/qemu-options.hx b/qemu-options.hx > index c534a2f..7470def 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -1297,10 +1297,14 @@ is a TCP port number, not a display number. > @item websocket > > Opens an additional TCP listening port dedicated to VNC Websocket > connections. > -By definition the Websocket port is 5700+@var{display}. If @var{host} is > -specified connections will only be allowed from this host. > -As an alternative the Websocket port could be specified by using > -@code{websocket}=@var{port}. > +If a bare @var{websocket} option is given, the Websocket port is > +5700+@var{display}. An alternative port can be specified with the > +syntax @code{websocket}=@var{port}. > + > +If @var{host} is specified connections will only be allowed from this host. > +It is possible to control the websocket listen address independantly using
s/independantly/independently,/ > +the syntax @code{websocket}=@var{host}:@var{port}. > + > If no TLS credentials are provided, the websocket connection runs in > unencrypted mode. If TLS credentials are provided, the websocket connection > requires encrypted client connections. > diff --git a/ui/vnc.c b/ui/vnc.c > index b37aab4..8d3f9c1 100644 > --- a/ui/vnc.c > +++ b/ui/vnc.c > @@ -3519,6 +3519,178 @@ vnc_display_create_creds(bool x509, > } > > Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature