[...] static struct libwebsocket_protocols protocols[] = { { "my_protocol", /* protocol name */ my_callback, /* callback */ sizeof(struct per_session_data) /* max frame size / rx buffer */ }, { NULL, NULL, 0 } }; [...] struct lws_context_creation_info info; [...] memset (&info, 0, sizeof info); info.port = 8080; info.iface = NULL; info.protocols = protocols; info.extensions = libwebsocket_get_internal_extensions(); info.gid = -1; info.uid = -1; info.options = 0; info.ssl_cert_filepath = NULL; info.ssl_private_key_filepath = NULL; [...] static struct libwebsocket_context *context; context = libwebsocket_create_context (&info); if (context == NULL) { print_log (LOG_ERR, "(main) libwebsocket context init failed\n"); goto out; } [...]