From 63bb37276e028ab1b1c156c9e7907bf22b6d5952 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Fri, 19 Oct 2012 11:27:57 +0200 Subject: server: add websockets support via libwebsockets New API: spice_server_set_ws_ports This adds an optional dependency on libwebsockets. You need to get my patched 0.0.3 version here: git://people.freedesktop.org/~alon/libwebsockets There is no qemu patches yet, to test change in reds.c the default value of spice_ws_port to 5959 (for the default of spice-html5). For testing there is an online client at http://spice-space.org/spice-html5/spice.html Known issues: 1. The tester (server/tests/test_display_no_ssl) gets into dropping all data after a few seconds, I think it's an issue with the implemented watches, but haven't figured it out. 2. libwebsocket's read interface is inverted to what our code expects, i.e. there is no libwebsocket_read, so there is an additional copy involved (see RedsWebSocket). This can be fixed. 3. Listening on a separate port. Since the headers are different, we could listen on the same port (first three bytes RED/GET). I don't know if we want to? Todos: 1. SSL not implemented yet. Needs some thought as to how. 2. Serve spice-html5 when accessed as a http server. Nice to have. --- server/Makefile.am | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'server/Makefile.am') diff --git a/server/Makefile.am b/server/Makefile.am index b62d98c0..4c01c313 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -10,6 +10,7 @@ AM_CPPFLAGS = \ $(SLIRP_CFLAGS) \ $(SMARTCARD_CFLAGS) \ $(SSL_CFLAGS) \ + $(LIBWEBSOCKETS_CFLAGS) \ $(VISIBILITY_HIDDEN_CFLAGS) \ $(WARN_CFLAGS) \ $(NULL) @@ -38,6 +39,7 @@ libspice_server_la_LIBADD = \ $(SLIRP_LIBS) \ $(SSL_LIBS) \ $(Z_LIBS) \ + $(LIBWEBSOCKETS_LIBS) \ $(NULL) libspice_server_la_SOURCES = \ @@ -93,6 +95,13 @@ libspice_server_la_SOURCES = \ zlib_encoder.h \ $(NULL) +if SUPPORT_WEBSOCKETS +libspice_server_la_SOURCES += \ + reds_websockets.c \ + reds_websockets.h \ + $(NULL) +endif + if SUPPORT_TUNNEL libspice_server_la_SOURCES += \ red_tunnel_worker.c \ -- cgit