summaryrefslogtreecommitdiffstats
path: root/server/tests/test_display_base.c
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-10-19 11:27:57 +0200
committerAlon Levy <alevy@redhat.com>2012-10-25 12:33:02 +0200
commit63bb37276e028ab1b1c156c9e7907bf22b6d5952 (patch)
tree4f4d91513179b61ffb433af28a92fe7352fdf8c9 /server/tests/test_display_base.c
parent2c85436dc6c2e9febecfb84c579e7a50a4a6bd6b (diff)
downloadspice-63bb37276e028ab1b1c156c9e7907bf22b6d5952.tar.gz
spice-63bb37276e028ab1b1c156c9e7907bf22b6d5952.tar.xz
spice-63bb37276e028ab1b1c156c9e7907bf22b6d5952.zip
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.
Diffstat (limited to 'server/tests/test_display_base.c')
-rw-r--r--server/tests/test_display_base.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
index 588e960f..9eaa5847 100644
--- a/server/tests/test_display_base.c
+++ b/server/tests/test_display_base.c
@@ -701,13 +701,14 @@ static int flush_resources(QXLInstance *qin)
return TRUE;
}
-static void client_monitors_config(QXLInstance *qin, VDAgentMonitorsConfig *monitors_config)
+static int client_monitors_config(QXLInstance *qin, VDAgentMonitorsConfig *monitors_config)
{
if (!monitors_config) {
printf("%s: NULL monitors_config\n", __func__);
} else {
printf("%s: %d\n", __func__, monitors_config->num_of_monitors);
}
+ return 0;
}
QXLInterface display_sif = {
@@ -815,6 +816,7 @@ Test *test_new(SpiceCoreInterface *core)
printf("TESTER: listening on port %d (unsecure)\n", port);
spice_server_set_port(server, port);
spice_server_set_noauth(server);
+ spice_server_set_ws_ports(test->server, 5959, -1);
spice_server_init(server, core);
cursor_init();