summaryrefslogtreecommitdiff
path: root/src/muniad.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/muniad.cc')
-rw-r--r--src/muniad.cc26
1 files changed, 21 insertions, 5 deletions
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;