From 4bed17fc7a8acbd531de761128e77fbb861fc013 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 5 Dec 2013 15:38:13 +0100 Subject: Update for libwebsockets-1.23. --- src/muniad.cc | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/muniad.cc') diff --git a/src/muniad.cc b/src/muniad.cc index ebf0870..995bb67 100644 --- a/src/muniad.cc +++ b/src/muniad.cc @@ -96,7 +96,7 @@ int main(int argc, char **argv) // case 'd': // dumpfile = optarg; case 'k': - opts = LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK; + //opts = LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK; break; case 'p': port = atoi(optarg); @@ -121,10 +121,26 @@ int main(int argc, char **argv) if(!use_ssl) cert_path = key_path = NULL; - context = libwebsocket_create_context(port, interface, protocols, - libwebsocket_internal_extensions, - cert_path, key_path, "", -1, -1, opts, - NULL); + struct lws_context_creation_info info; + memset(&info, 0, sizeof info); + info.port = port; + info.iface = interface; + info.protocols = protocols; + info.extensions = libwebsocket_get_internal_extensions(); + + //if (!use_ssl) { + info.ssl_cert_filepath = cert_path; + info.ssl_private_key_filepath = NULL; + //} else { + // info.ssl_cert_filepath = LOCAL_RESOURCE_PATH"/libwebsockets-test-server.pem"; + // info.ssl_private_key_filepath = LOCAL_RESOURCE_PATH"/libwebsockets-test-server.key.pem"; +//} + + info.gid = -1; + info.uid = -1; + info.options = opts; + + context = libwebsocket_create_context(&info); if (context == NULL) { fprintf(stderr, "libwebsocket init failed\n"); return -1; -- cgit v1.2.3