mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
examples-lowlevel: ws-server: pvo for WITH_PLUGINS
This commit is contained in:
parent
b5b7e793d4
commit
3755f56d5e
1 changed files with 8 additions and 0 deletions
|
@ -54,6 +54,11 @@ static const struct lws_http_mount mount = {
|
||||||
/* .basic_auth_login_file */ NULL,
|
/* .basic_auth_login_file */ NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(LWS_WITH_PLUGINS)
|
||||||
|
/* if plugins enabled, only protocols explicitly named in pvo bind to vhost */
|
||||||
|
static struct lws_protocol_vhost_options pvo = { NULL, NULL, "lws-minimal", "" };
|
||||||
|
#endif
|
||||||
|
|
||||||
void sigint_handler(int sig)
|
void sigint_handler(int sig)
|
||||||
{
|
{
|
||||||
interrupted = 1;
|
interrupted = 1;
|
||||||
|
@ -85,6 +90,9 @@ int main(int argc, const char **argv)
|
||||||
info.mounts = &mount;
|
info.mounts = &mount;
|
||||||
info.protocols = protocols;
|
info.protocols = protocols;
|
||||||
info.vhost_name = "localhost";
|
info.vhost_name = "localhost";
|
||||||
|
#if defined(LWS_WITH_PLUGINS)
|
||||||
|
info.pvo = &pvo;
|
||||||
|
#endif
|
||||||
info.options =
|
info.options =
|
||||||
LWS_SERVER_OPTION_HTTP_HEADERS_SECURITY_BEST_PRACTICES_ENFORCE;
|
LWS_SERVER_OPTION_HTTP_HEADERS_SECURITY_BEST_PRACTICES_ENFORCE;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue