libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
lws-context-vhost.h
Go to the documentation of this file.
1/*
2 * libwebsockets - small server side websockets and web server implementation
3 *
4 * Copyright (C) 2010 - 2021 Andy Green <andy@warmcat.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 * IN THE SOFTWARE.
23 */
24
39
40/*
41 * NOTE: These public enums are part of the abi. If you want to add one,
42 * add it at where specified so existing users are unaffected.
43 */
44
45
46#define LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT ((1ll << 1) | \
47 (1ll << 12))
48
51#define LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME (1ll << 2)
53#define LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT ((1ll << 3) | \
54 (1ll << 12))
55
61#define LWS_SERVER_OPTION_LIBEV (1ll << 4)
63#define LWS_SERVER_OPTION_DISABLE_IPV6 (1ll << 5)
65#define LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS (1ll << 6)
68#define LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED (1ll << 7)
70#define LWS_SERVER_OPTION_VALIDATE_UTF8 (1ll << 8)
72#define LWS_SERVER_OPTION_SSL_ECDH ((1ll << 9) | \
73 (1ll << 12))
74
75#define LWS_SERVER_OPTION_LIBUV (1ll << 10)
77#define LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS ((1ll << 11) |\
78 (1ll << 12))
79
88#define LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT (1ll << 12)
90#define LWS_SERVER_OPTION_EXPLICIT_VHOSTS (1ll << 13)
93#define LWS_SERVER_OPTION_UNIX_SOCK (1ll << 14)
95#define LWS_SERVER_OPTION_STS (1ll << 15)
98#define LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY (1ll << 16)
100#define LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE (1ll << 17)
102#define LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN (1ll << 18)
108#define LWS_SERVER_OPTION_JUST_USE_RAW_ORIGIN (1ll << 19)
115#define LWS_SERVER_OPTION_FALLBACK_TO_RAW /* use below name */ (1ll << 20)
116#define LWS_SERVER_OPTION_FALLBACK_TO_APPLY_LISTEN_ACCEPT_CONFIG (1ll << 20)
128
129#define LWS_SERVER_OPTION_LIBEVENT (1ll << 21)
131
132#define LWS_SERVER_OPTION_ONLY_RAW /* Use below name instead */ (1ll << 22)
133#define LWS_SERVER_OPTION_ADOPT_APPLY_LISTEN_ACCEPT_CONFIG (1ll << 22)
146#define LWS_SERVER_OPTION_ALLOW_LISTEN_SHARE (1ll << 23)
152#define LWS_SERVER_OPTION_CREATE_VHOST_SSL_CTX (1ll << 24)
159#define LWS_SERVER_OPTION_SKIP_PROTOCOL_INIT (1ll << 25)
164#define LWS_SERVER_OPTION_IGNORE_MISSING_CERT (1ll << 26)
170#define LWS_SERVER_OPTION_VHOST_UPG_STRICT_HOST_CHECK (1ll << 27)
181#define LWS_SERVER_OPTION_HTTP_HEADERS_SECURITY_BEST_PRACTICES_ENFORCE (1ll << 28)
197
198#define LWS_SERVER_OPTION_ALLOW_HTTP_ON_HTTPS_LISTENER (1ll << 29)
206#define LWS_SERVER_OPTION_FAIL_UPON_UNABLE_TO_BIND (1ll << 30)
210
211#define LWS_SERVER_OPTION_H2_JUST_FIX_WINDOW_UPDATE_OVERFLOW (1ll << 31)
214
215#define LWS_SERVER_OPTION_VH_H2_HALF_CLOSED_LONG_POLL (1ll << 32)
220#define LWS_SERVER_OPTION_DISABLE_UTF8_VALIDATION (1ll << 34)
224
225 /****** add new things just above ---^ ******/
226
227#define LWS_SERVER_OPTION_GLIB (1ll << 33)
229
230#define LWS_SERVER_OPTION_QUIC_FORCE_RETRY (1ll << 52)
233
234#define LWS_SERVER_OPTION_H2_PRIOR_KNOWLEDGE (1ll << 34)
238
239#define LWS_SERVER_OPTION_NO_LWS_SYSTEM_STATES (1ll << 35)
242
243#define LWS_SERVER_OPTION_SS_PROXY (1ll << 36)
245
246#define LWS_SERVER_OPTION_SDEVENT (1ll << 37)
248
249#define LWS_SERVER_OPTION_ULOOP (1ll << 38)
251
252#define LWS_SERVER_OPTION_DISABLE_TLS_SESSION_CACHE (1ll << 39)
254
255#define LWS_SERVER_OPTION_OPENSSL_AUTO_DH_PARAMETERS (1ll << 40)
261
262#define LWS_SERVER_OPTION_MBEDTLS_VERIFY_CLIENT_CERT_POST_HANDSHAKE ((1ll << 41) | \
263 (1ll << 12))
264
271
272#define LWS_SERVER_OPTION_VH_INSTANTIATE_ALL_PROTOCOLS (1ll << 42)
274
275#define LWS_SERVER_OPTION_VH_SKIP_PRIV_DROP (1ll << 43)
278
279#define LWS_SERVER_OPTION_CMDLINE_FORCE_H1 (1ll << 44)
281
282#define LWS_SERVER_OPTION_CMDLINE_FORCE_H2 (1ll << 45)
284
285#define LWS_SERVER_OPTION_CMDLINE_FORCE_H3 (1ll << 46)
287
288#define LWS_SERVER_OPTION_ALLOW_EARLY_DATA (1ll << 47)
294
295#define LWS_SERVER_OPTION_CPD_BYPASS (1ll << 48)
297
298#define LWS_SERVER_OPTION_QUIC_PAD_CRYPTO (1ll << 49)
300
301#define LWS_SERVER_OPTION_QUIC_EARLY_KEY_UPDATE (1ll << 51)
303
304#define LWS_SERVER_OPTION_QUIC_LATEST_VERSION (1ll << 50)
306
307#define LWS_SERVER_OPTION_SNI_FALLBACK (1ll << 53)
317
318#define LWS_SERVER_OPTION_DISABLE_IPV4 (1ll << 54)
324
325#define LWS_SERVER_OPTION_NO_HTTP_STREAM_COMPRESSION (1ll << 55)
333
334 /****** add new things just above ---^ ******/
335
336
337#define lws_check_opt(c, f) ((((uint64_t)c) & ((uint64_t)f)) == ((uint64_t)f))
338
339struct lws_plat_file_ops;
340struct lws_ss_policy;
341struct lws_ss_plugin;
342struct lws_metric_policy;
343struct lws_sss_ops;
344
345typedef int (*lws_context_ready_cb_t)(struct lws_context *context);
346
347#if defined(LWS_WITH_NETWORK)
348typedef int (*lws_peer_limits_notify_t)(struct lws_context *ctx,
349 lws_sockfd_type sockfd,
350 lws_sockaddr46 *sa46);
351#endif
352
364typedef uint64_t (*lws_quic_tx_credit_cb_t)(struct lws *wsi, uint64_t current_window,
365 uint64_t consumed_bytes, uint64_t time_since_last_update_us);
366
367/*
368 * Largest info->pt_serv_buf_size lws accepts, bigger requests are clamped to
369 * it. Each service thread takes twice this after the context allocation.
370 */
371#define LWS_PT_SERV_BUF_SIZE_MAX (16u * 1024u * 1024u)
372
382/*
383 * Per-service-thread fd budget, for info.fd_limit_per_thread
384 *
385 * A nonzero fd_limit_per_thread selects the small lookup scheme: the fds
386 * table and the fd -> wsi lookup are sized to it instead of to the process
387 * fd limit, and lookups walk the table. The number has to cover more than
388 * the connections the application itself makes.
389 *
390 * LWS_FD_LIMIT_INTERNAL is what lws itself holds on a service thread in this
391 * build: the event pipe, the netlink socket, the async DNS resolver sockets,
392 * the ntp and dhcp client sockets, and the slot it keeps free so a full table
393 * is seen before an accept fails. A nonzero fd_limit_per_thread below it is
394 * raised to it at context creation.
395 *
396 * LWS_FD_LIMIT_PER_THREAD_MIN adds the overhead connections carry beyond
397 * their own fd: the h2 or h3 network connection behind a client stream, the
398 * connection a redirect opens before the first is gone, a listening vhost's
399 * socket or two, and connections lingering in close. Set
400 *
401 * info.fd_limit_per_thread = LWS_FD_LIMIT_PER_THREAD_MIN + n;
402 *
403 * where n is the number of connections you mean to have open at once, or
404 * leave it 0 to size everything to the process fd limit, which suits a
405 * server.
406 */
407#if defined(LWS_WITH_NETLINK)
408#define LWS_FD_LIMIT_INTERNAL_NETLINK 1
409#else
410#define LWS_FD_LIMIT_INTERNAL_NETLINK 0
411#endif
412#if defined(LWS_WITH_SYS_ASYNC_DNS)
413#define LWS_FD_LIMIT_INTERNAL_ADNS 2 /* the resolver's query sockets */
414#else
415#define LWS_FD_LIMIT_INTERNAL_ADNS 0
416#endif
417#if defined(LWS_WITH_SYS_NTPCLIENT)
418#define LWS_FD_LIMIT_INTERNAL_NTP 1
419#else
420#define LWS_FD_LIMIT_INTERNAL_NTP 0
421#endif
422#if defined(LWS_WITH_SYS_DHCP_CLIENT)
423#define LWS_FD_LIMIT_INTERNAL_DHCP 1
424#else
425#define LWS_FD_LIMIT_INTERNAL_DHCP 0
426#endif
427
428#define LWS_FD_LIMIT_INTERNAL (1 /* event pipe */ + 1 /* kept free */ + \
429 LWS_FD_LIMIT_INTERNAL_NETLINK + \
430 LWS_FD_LIMIT_INTERNAL_ADNS + \
431 LWS_FD_LIMIT_INTERNAL_NTP + \
432 LWS_FD_LIMIT_INTERNAL_DHCP)
433
434#define LWS_FD_LIMIT_PER_THREAD_MIN (LWS_FD_LIMIT_INTERNAL + 8 /* overhead */)
435
436/* for .http_body_min_rate: a request body may arrive as slowly as it likes */
437#define LWS_HTTP_BODY_MIN_RATE_NONE 0xffffffffu
438/* for .mux_reset_limit: a connection's streams may be reset without limit */
439#define LWS_MUX_RESET_LIMIT_NONE 0xffffu
440
442#if defined(LWS_WITH_NETWORK)
443 const char *iface;
450 const struct lws_protocols *protocols;
456#if defined(LWS_ROLE_WS)
457 const struct lws_extension *extensions;
460#endif
461#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) || defined(LWS_ROLE_H3)
462 const struct lws_token_limits *token_limits;
467 const char *http_proxy_address;
471 const struct lws_protocol_vhost_options *headers;
474
475 const struct lws_protocol_vhost_options *reject_service_keywords;
482#endif
483 const struct lws_protocol_vhost_options *pvo;
489 const char *log_filepath;
501#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) || defined(LWS_ROLE_H3)
502 const struct lws_http_mount *mounts;
504 const char *server_string;
507
508 const char *error_document_404;
512#endif
513 int port;
525
526#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) || defined(LWS_ROLE_H3)
527 unsigned int http_proxy_port;
529 unsigned int max_http_header_data2;
534 unsigned int max_http_header_pool2;
539#endif
540
541 int keepalive_timeout;
545#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) || defined(LWS_ROLE_H3)
546 uint32_t http2_settings[7];
555
556 unsigned short max_http_header_data;
559 unsigned short max_http_header_pool;
566
567#endif
568
569#if defined(LWS_WITH_TLS)
570 const char *ssl_private_key_password;
575 const char *ssl_cert_filepath;
587 const char *ssl_private_key_filepath;
606 const char *ssl_ca_filepath;
615 const char *ssl_cipher_list;
631 const char *tls_ciphers_iana;
637 const char *ecdh_curve;
651 const char *client_ecdh_curve;
661 const char *tls1_3_plus_cipher_list;
671
672 const void *server_ssl_cert_mem;
676 const void *server_ssl_private_key_mem;
681 const void *server_ssl_ca_mem;
685
686 long ssl_options_set;
688 long ssl_options_clear;
690 int simultaneous_ssl_restriction;
698 int simultaneous_ssl_handshake_restriction;
701 int ssl_info_event_mask;
707 unsigned int server_ssl_cert_mem_len;
710 unsigned int server_ssl_private_key_mem_len;
712 unsigned int server_ssl_ca_mem_len;
714
715 const char *alpn;
722
723
724#if defined(LWS_WITH_CLIENT)
725 const char *client_ssl_private_key_password;
728 const char *client_ssl_cert_filepath;
731 const void *client_ssl_cert_mem;
734 unsigned int client_ssl_cert_mem_len;
737 const char *client_ssl_private_key_filepath;
743 const void *client_ssl_key_mem;
746 const char *client_ssl_ca_filepath;
748 const void *client_ssl_ca_mem;
753
754 const char *client_ssl_cipher_list;
765 const char *client_tls_ciphers_iana;
771 const char *client_tls_1_3_plus_cipher_list;
780
781 long ssl_client_options_set;
783 long ssl_client_options_clear;
785
786
787 unsigned int client_ssl_ca_mem_len;
790 unsigned int client_ssl_key_mem_len;
793
794#endif
795
796#if !defined(LWS_WITH_MBEDTLS) && !defined(LWS_WITH_BEARSSL) && \
797 !defined(LWS_WITH_OPENHITLS)
798 SSL_CTX *provided_client_ssl_ctx;
803#elif defined(LWS_WITH_MBEDTLS)
804 const char *mbedtls_client_preload_filepath;
814#endif
815#endif
816
817 int ka_time;
820 int ka_probes;
824 int ka_interval;
827 unsigned int timeout_secs;
832 unsigned int connect_timeout_secs;
836 int bind_iface;
847 unsigned int timeout_secs_ah_idle;
850#endif /* WITH_NETWORK */
851
852#if defined(LWS_WITH_TLS_SESSIONS)
853 uint32_t tls_session_timeout;
856 uint32_t tls_session_cache_max;
859#endif
860
861 gid_t gid;
864 uid_t uid;
867 uint64_t options;
869 void *user;
878 unsigned int count_threads;
899 const char *vhost_name;
906#if defined(LWS_WITH_PLUGINS)
907 const char * const *plugin_dirs;
910#endif
918
919
920 unsigned int pt_serv_buf_size;
928#if defined(LWS_WITH_FILE_OPS)
929 const struct lws_plat_file_ops *fops;
936#endif
937
938#if defined(LWS_WITH_SOCKS5)
939 const char *socks_proxy_address;
943 unsigned int socks_proxy_port;
947#endif
948
949#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP)
950 cap_value_t caps[4];
957 char count_caps;
960#endif
975 void (*signal_cb)(void *event_lib_handle, int signum);
981 struct lws_context **pcontext;
987 void (*finalize)(struct lws_vhost *vh, void *arg);
1015
1016 const char *username;
1018 const char *groupname;
1020 const char *unix_socket_perms;
1031#if defined(LWS_WITH_SYS_STATE)
1032 lws_state_notify_link_t * const *register_notifier_list;
1036#endif
1037#if defined(LWS_WITH_SECURE_STREAMS)
1038#if defined(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY)
1039 const struct lws_ss_policy *pss_policies;
1041#else
1042 const char *pss_policies_json;
1049#endif
1050 const struct lws_ss_plugin **pss_plugins;
1053 const char *ss_proxy_bind;
1077 const char *ss_proxy_address;
1079 uint16_t ss_proxy_port; /* 0 = if connecting to ss proxy, do it via a
1080 * Unix Domain Socket, "+@proxy.ss.lws" if ss_proxy_bind is NULL else
1081 * the socket path given in ss_proxy_bind (start it with a + or +@);
1082 * nonzero means connect via a tcp socket to the tcp address in
1083 * ss_proxy_bind and the given port. The tcp link has no
1084 * authentication in either direction: the proxy cannot tell who its
1085 * clients are, nor the clients who the proxy is. */
1086 const struct lws_transport_proxy_ops *txp_ops_ssproxy;
1089 const void *txp_ssproxy_info;
1091 const struct lws_transport_client_ops *txp_ops_sspc;
1094#endif
1095
1096#if defined(LWS_WITH_SECURE_STREAMS_PROXY_API)
1097#endif
1098
1103#if defined(LWS_WITH_PEER_LIMITS)
1104 lws_peer_limits_notify_t pl_notify_cb;
1119 unsigned short ip_limit_ah;
1127 unsigned short ip_limit_wsi;
1143
1144#endif /* PEER_LIMITS */
1145
1146#if defined(LWS_WITH_SYS_FAULT_INJECTION)
1147 lws_fi_ctx_t fic;
1154#endif
1155
1156#if defined(LWS_WITH_SYS_SMD)
1157 lws_smd_notification_cb_t early_smd_cb;
1164 void *early_smd_opaque;
1165 lws_smd_class_t early_smd_class_filter;
1166 lws_usec_t smd_ttl_us;
1171 uint16_t smd_queue_depth;
1174#endif
1175
1176#if defined(LWS_WITH_SYS_METRICS)
1177 const struct lws_metric_policy *metrics_policies;
1179 const char *metrics_prefix;
1186#endif
1187
1193
1203
1204#if defined(LWS_WITH_TLS_JIT_TRUST)
1205 size_t jitt_cache_max_footprint;
1208 int vh_idle_grace_ms;
1211#endif
1212
1216
1217#if defined(LWS_WITH_CACHE_NSCOOKIEJAR) && defined(LWS_WITH_CLIENT)
1218 const char *http_nsc_filepath;
1220
1221 size_t http_nsc_heap_max_footprint;
1224 size_t http_nsc_heap_max_items;
1227 size_t http_nsc_heap_max_payload;
1230#endif
1231
1232#if defined(LWS_WITH_CACHE_BLOB)
1233 const char *dlo_asset_cache_dir;
1239
1240 size_t dlo_asset_cache_max_footprint;
1243#endif
1244
1245#if defined(LWS_WITH_SYS_ASYNC_DNS)
1246 const char **async_dns_servers;
1252
1253#endif
1254
1255#if defined(WIN32)
1256 unsigned int win32_connect_check_interval_usec;
1261#endif
1262
1269
1277
1278#if defined(LWS_WITH_NETWORK)
1279 const char *wol_if;
1281#endif
1282
1283 const char *lws_stub;
1287 int argc;
1290 const char **argv;
1293
1294#if defined(LWS_WITH_ASYNC_QUEUE)
1295 uint8_t count_async_threads;
1300#endif
1301
1311
1325
1326 /* Add new things just above here ---^
1327 * This is part of the ABI, don't needlessly break compatibility
1328 *
1329 * The below is to ensure later library versions with new
1330 * members added above will see 0 (default) even if the app
1331 * was not built against the newer headers.
1332 */
1333
1336
1339
1342
1346
1349
1355
1361
1364
1365 const struct lws_io_ops *io_ops;
1368
1369 const struct lws_plugin_protocol * const *plugins;
1379
1380 const char *ss_proxy_perms;
1404
1416
1417 const char *tls_passthrough;
1427
1433
1434 const char *proxy_v2_trusted;
1460
1470
1494
1512
1516
1538
1541
1557
1558#if defined(LWS_WITH_PEER_LIMITS)
1559 unsigned int unproven_limit_wsi;
1581#endif
1582
1583#if !defined(__STRICT_ANSI__)
1584 void *_unused[1];
1585#endif
1586};
1587
1622LWS_VISIBLE LWS_EXTERN struct lws_context *
1624
1625
1635lws_context_destroy(struct lws_context *context);
1636
1648
1649typedef int (*lws_reload_func)(void);
1650
1674lws_context_deprecate(struct lws_context *context, lws_reload_func cb);
1675
1677lws_context_is_deprecated(struct lws_context *context);
1678
1697lws_set_proxy(struct lws_vhost *vhost, const char *proxy);
1698
1717lws_set_socks(struct lws_vhost *vhost, const char *socks);
1718
1719struct lws_vhost;
1720
1730LWS_VISIBLE LWS_EXTERN struct lws_vhost *
1731lws_create_vhost(struct lws_context *context,
1732 const struct lws_context_creation_info *info);
1733
1753lws_vhost_destroy(struct lws_vhost *vh);
1754
1769
1801 char **config_strings, int *len);
1802
1826 struct lws_context_creation_info *info,
1827 const char *d, char **config_strings, int *len);
1828
1856lwsws_get_config_vhosts(struct lws_context *context,
1857 struct lws_context_creation_info *info, const char *d,
1858 char **config_strings, int *len);
1859
1884 struct lws_context *context,
1885 struct lws_context_creation_info *info,
1886 const char *d, char **config_strings, int *len);
1887
1893LWS_VISIBLE LWS_EXTERN struct lws_vhost *
1894lws_get_vhost(struct lws *wsi);
1895
1901LWS_VISIBLE LWS_EXTERN const char *
1902lws_get_vhost_name(struct lws_vhost *vhost);
1903
1912LWS_VISIBLE LWS_EXTERN struct lws_vhost *
1913lws_get_vhost_by_name(struct lws_context *context, const char *name);
1914
1943LWS_VISIBLE LWS_EXTERN struct lws_vhost *
1944lws_select_vhost_sni(struct lws_vhost *lv, const char *servername);
1945
1952lws_get_vhost_port(struct lws_vhost *vhost);
1953
1960lws_get_vhost_user(struct lws_vhost *vhost);
1961
1967LWS_VISIBLE LWS_EXTERN const char *
1968lws_get_vhost_iface(struct lws_vhost *vhost);
1969
1979lws_vhost_user(struct lws_vhost *vhost);
1980
1991lws_context_user(struct lws_context *context);
1992
1993LWS_VISIBLE LWS_EXTERN const char *
1994lws_vh_tag(struct lws_vhost *vh);
1995
2017 const char *sspol);
2018
2040lws_default_loop_exit(struct lws_context *cx);
2041
2044
2046lws_cmdline_passfail(int argc, const char **argv, int actual);
2047
2059lws_systemd_inherited_fd(unsigned int index,
2060 struct lws_context_creation_info *info);
2061
2078lws_context_is_being_destroyed(struct lws_context *context);
2079
2086
2098
2117
2126
2128#define AUTH_MODE_MASK 0xF0000000
2129
2137 const char *mountpoint;
2139 const char *origin;
2141 const char *def;
2143 const char *protocol;
2145
2154
2159 unsigned int auth_mask;
2161
2162 unsigned int cache_reusable:1;
2163 unsigned int cache_revalidate:1;
2164 unsigned int cache_intermediaries:1;
2165 unsigned int cache_no:1;
2166 unsigned int exact_match:1;
2167 unsigned int append_path:1;
2168 unsigned int no_ws_upgrades:1;
2169
2170 unsigned char origin_protocol;
2171 unsigned char mountpoint_len;
2172
2175
2176 const char *cgi_chroot_path;
2178
2179 const char *cgi_wd;
2183
2192 unsigned int keepalive_timeout;
2196#if defined(LWS_WITH_JOSE)
2197 const char *interceptor_path;
2201#endif
2202
2205
2206 /* Add new things just above here ---^
2207 * This is part of the ABI, don't needlessly break compatibility
2208 */
2209};
2210
2212lws_vhost_set_mounts(struct lws_vhost *v, const struct lws_http_mount *mounts);
2213
const lws_system_ops_t * system_ops
const struct lws_plugin_evlib * event_lib_custom
void(* finalize)(struct lws_vhost *vh, void *arg)
const struct lws_protocols ** pprotocols
const struct lws_plugin_protocol *const * plugins
struct lws_context ** pcontext
const struct lws_io_ops * io_ops
lws_quic_tx_credit_cb_t quic_tx_credit_cb
lws_dll2_owner_t owner
const lws_retry_bo_t * retry_and_idle_policy
const struct lws_protocol_vhost_options * next
void(* signal_cb)(void *event_lib_handle, int signum)
const struct lws_cc_ops * quic_cc_ops
const struct lws_protocol_vhost_options * options
LWS_VISIBLE LWS_EXTERN void lws_context_deprecate(struct lws_context *context, lws_reload_func cb)
LWS_VISIBLE LWS_EXTERN void lws_context_default_loop_run_destroy(struct lws_context *cx)
int(* lws_reload_func)(void)
LWS_VISIBLE LWS_EXTERN int lwsws_get_config_globals_defs(struct lws_lejp_conf_defs *defs, struct lws_context_creation_info *info, const char *d, char **config_strings, int *len)
LWS_VISIBLE LWS_EXTERN struct lws_vhost * lws_get_vhost(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lwsws_get_config_vhosts(struct lws_context *context, struct lws_context_creation_info *info, const char *d, char **config_strings, int *len)
LWS_VISIBLE LWS_EXTERN struct lws_vhost * lws_create_vhost(struct lws_context *context, const struct lws_context_creation_info *info)
LWS_VISIBLE LWS_EXTERN int lws_cmdline_passfail(int argc, const char **argv, int actual)
LWS_VISIBLE LWS_EXTERN void * lws_vhost_user(struct lws_vhost *vhost)
uint64_t(* lws_quic_tx_credit_cb_t)(struct lws *wsi, uint64_t current_window, uint64_t consumed_bytes, uint64_t time_since_last_update_us)
LWS_VISIBLE LWS_EXTERN int lws_set_proxy(struct lws_vhost *vhost, const char *proxy)
LWS_VISIBLE LWS_EXTERN struct lws_context * lws_create_context(const struct lws_context_creation_info *info)
LWS_VISIBLE LWS_EXTERN void lws_default_loop_exit(struct lws_context *cx)
LWS_VISIBLE LWS_EXTERN void lws_context_destroy(struct lws_context *context)
LWS_VISIBLE LWS_EXTERN int lwsws_get_config_globals(struct lws_context_creation_info *info, const char *d, char **config_strings, int *len)
LWS_VISIBLE LWS_EXTERN void lws_tls_cleanup_process(void)
LWS_VISIBLE LWS_EXTERN struct lws_vhost * lws_select_vhost_sni(struct lws_vhost *lv, const char *servername)
LWS_VISIBLE LWS_EXTERN int lws_set_socks(struct lws_vhost *vhost, const char *socks)
LWS_VISIBLE LWS_EXTERN const char * lws_vh_tag(struct lws_vhost *vh)
LWS_VISIBLE LWS_EXTERN const char * lws_get_vhost_name(struct lws_vhost *vhost)
LWS_VISIBLE LWS_EXTERN struct lws_vhost * lws_get_vhost_by_name(struct lws_context *context, const char *name)
LWS_VISIBLE LWS_EXTERN int lws_get_vhost_port(struct lws_vhost *vhost)
LWS_VISIBLE LWS_EXTERN void lws_vhost_destroy(struct lws_vhost *vh)
LWS_VISIBLE LWS_EXTERN const char * lws_get_vhost_iface(struct lws_vhost *vhost)
LWS_VISIBLE LWS_EXTERN int lws_systemd_inherited_fd(unsigned int index, struct lws_context_creation_info *info)
LWS_VISIBLE LWS_EXTERN void _lws_context_info_defaults(struct lws_context_creation_info *info, const char *sspol)
LWS_VISIBLE LWS_EXTERN int lwsws_get_config_vhosts_defs(struct lws_lejp_conf_defs *defs, struct lws_context *context, struct lws_context_creation_info *info, const char *d, char **config_strings, int *len)
LWS_VISIBLE LWS_EXTERN int lws_context_is_deprecated(struct lws_context *context)
LWS_VISIBLE LWS_EXTERN int lws_context_is_being_destroyed(struct lws_context *context)
LWS_VISIBLE LWS_EXTERN void * lws_context_user(struct lws_context *context)
LWS_VISIBLE LWS_EXTERN void * lws_get_vhost_user(struct lws_vhost *vhost)
int(* lws_context_ready_cb_t)(struct lws_context *context)
struct lws_dll2_owner lws_dll2_owner_t
struct lws_log_cx lws_log_cx_t
const struct lws_http_mount * mount_next
const char * protocol
const struct lws_protocol_vhost_options * interpret
unsigned int keepalive_timeout
unsigned int cache_no
const char * basic_auth_login_file
const struct lws_protocol_vhost_options * extra_mimetypes
unsigned int auth_mask
unsigned char origin_protocol
unsigned int cache_reusable
unsigned int no_ws_upgrades
unsigned int append_path
const char * mountpoint
unsigned int cache_intermediaries
const char * cgi_chroot_path
unsigned char mountpoint_len
const struct lws_protocol_vhost_options * headers
unsigned int exact_match
unsigned int cache_revalidate
const struct lws_protocol_vhost_options * cgienv
lws_mount_protocols
LWS_VISIBLE LWS_EXTERN void lws_vhost_set_mounts(struct lws_vhost *v, const struct lws_http_mount *mounts)
lws_authentication_mode
@ LWSMPRO_NO_MOUNT
@ LWSMPRO_CGI
@ LWSMPRO_HTTP
@ LWSMPRO_FILE
@ LWSMPRO_CONNECT
@ LWSMPRO_REDIR_HTTPS
@ LWSMPRO_CALLBACK
@ LWSMPRO_REDIR_HTTP
@ LWSMPRO_HTTPS
@ LWSAUTHM_BASIC_AUTH_CALLBACK
@ LWSAUTHM_DEFAULT
unsigned short uint16_t
unsigned int uint32_t
#define LWS_EXTERN
int64_t lws_usec_t
unsigned char uint8_t
int lws_sockfd_type
#define LWS_VISIBLE
struct lws_retry_bo lws_retry_bo_t
int(* lws_smd_notification_cb_t)(void *opaque, lws_smd_class_t _class, lws_usec_t timestamp, void *buf, size_t len)
Definition lws-smd.h:208
uint32_t lws_smd_class_t
Definition lws-smd.h:31
struct lws_system_ops lws_system_ops_t