46 #define LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT ((1ll << 1) | \
51 #define LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME (1ll << 2)
53 #define LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT ((1ll << 3) | \
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) | \
75 #define LWS_SERVER_OPTION_LIBUV (1ll << 10)
77 #define LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS ((1ll << 11) |\
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 (1ll << 20)
116 #define LWS_SERVER_OPTION_FALLBACK_TO_APPLY_LISTEN_ACCEPT_CONFIG (1ll << 20)
129 #define LWS_SERVER_OPTION_LIBEVENT (1ll << 21)
132 #define LWS_SERVER_OPTION_ONLY_RAW (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)
198 #define LWS_SERVER_OPTION_ALLOW_HTTP_ON_HTTPS_LISTENER (1ll << 29)
206 #define LWS_SERVER_OPTION_FAIL_UPON_UNABLE_TO_BIND (1ll << 30)
211 #define LWS_SERVER_OPTION_H2_JUST_FIX_WINDOW_UPDATE_OVERFLOW (1ll << 31)
215 #define LWS_SERVER_OPTION_VH_H2_HALF_CLOSED_LONG_POLL (1ll << 32)
221 #define LWS_SERVER_OPTION_GLIB (1ll << 33)
224 #define LWS_SERVER_OPTION_H2_PRIOR_KNOWLEDGE (1ll << 34)
229 #define LWS_SERVER_OPTION_NO_LWS_SYSTEM_STATES (1ll << 35)
233 #define LWS_SERVER_OPTION_SS_PROXY (1ll << 36)
236 #define LWS_SERVER_OPTION_SDEVENT (1ll << 37)
239 #define LWS_SERVER_OPTION_ULOOP (1ll << 38)
242 #define LWS_SERVER_OPTION_DISABLE_TLS_SESSION_CACHE (1ll << 39)
249 #define lws_check_opt(c, f) ((((uint64_t)c) & ((uint64_t)f)) == ((uint64_t)f))
253 struct lws_ss_plugin;
259 #if defined(LWS_WITH_NETWORK)
260 typedef int (*lws_peer_limits_notify_t)(
struct lws_context *ctx,
275 #if defined(LWS_WITH_NETWORK)
289 #if defined(LWS_ROLE_WS)
294 #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)
298 const char *http_proxy_address;
316 const char *log_filepath;
321 const char *server_string;
325 const char *error_document_404;
342 unsigned int http_proxy_port;
344 unsigned int max_http_header_data2;
349 unsigned int max_http_header_pool2;
355 int keepalive_timeout;
366 unsigned short max_http_header_data;
369 unsigned short max_http_header_pool;
379 #if defined(LWS_WITH_TLS)
380 const char *ssl_private_key_password;
385 const char *ssl_cert_filepath;
397 const char *ssl_private_key_filepath;
416 const char *ssl_ca_filepath;
425 const char *ssl_cipher_list;
435 const char *ecdh_curve;
438 const char *tls1_3_plus_cipher_list;
446 const void *server_ssl_cert_mem;
450 const void *server_ssl_private_key_mem;
455 const void *server_ssl_ca_mem;
460 long ssl_options_set;
462 long ssl_options_clear;
464 int simultaneous_ssl_restriction;
467 int simultaneous_ssl_handshake_restriction;
469 int ssl_info_event_mask;
475 unsigned int server_ssl_cert_mem_len;
478 unsigned int server_ssl_private_key_mem_len;
480 unsigned int server_ssl_ca_mem_len;
492 #if defined(LWS_WITH_CLIENT)
493 const char *client_ssl_private_key_password;
496 const char *client_ssl_cert_filepath;
499 const void *client_ssl_cert_mem;
502 unsigned int client_ssl_cert_mem_len;
505 const char *client_ssl_private_key_filepath;
511 const void *client_ssl_key_mem;
514 const char *client_ssl_ca_filepath;
516 const void *client_ssl_ca_mem;
520 const char *client_ssl_cipher_list;
524 const char *client_tls_1_3_plus_cipher_list;
531 long ssl_client_options_set;
533 long ssl_client_options_clear;
537 unsigned int client_ssl_ca_mem_len;
540 unsigned int client_ssl_key_mem_len;
546 #if !defined(LWS_WITH_MBEDTLS)
547 SSL_CTX *provided_client_ssl_ctx;
553 const char *mbedtls_client_preload_filepath;
576 unsigned int timeout_secs;
581 unsigned int connect_timeout_secs;
596 unsigned int timeout_secs_ah_idle;
601 #if defined(LWS_WITH_TLS_SESSIONS)
652 #if defined(LWS_WITH_PLUGINS)
653 const char *
const *plugin_dirs;
672 #if defined(LWS_WITH_FILE_OPS)
682 #if defined(LWS_WITH_SOCKS5)
683 const char *socks_proxy_address;
687 unsigned int socks_proxy_port;
693 #if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP)
775 #if defined(LWS_WITH_SYS_STATE)
776 lws_state_notify_link_t *
const *register_notifier_list;
781 #if defined(LWS_WITH_SECURE_STREAMS)
782 #if defined(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY)
786 const char *pss_policies_json;
794 const struct lws_ss_plugin **pss_plugins;
797 const char *ss_proxy_bind;
802 const char *ss_proxy_address;
812 const void *txp_ssproxy_info;
819 #if defined(LWS_WITH_SECURE_STREAMS_PROXY_API)
826 #if defined(LWS_WITH_PEER_LIMITS)
827 lws_peer_limits_notify_t pl_notify_cb;
834 unsigned short ip_limit_ah;
842 unsigned short ip_limit_wsi;
852 #if defined(LWS_WITH_SYS_FAULT_INJECTION)
862 #if defined(LWS_WITH_SYS_SMD)
870 void *early_smd_opaque;
882 #if defined(LWS_WITH_SYS_METRICS)
885 const char *metrics_prefix;
910 #if defined(LWS_WITH_TLS_JIT_TRUST)
911 size_t jitt_cache_max_footprint;
914 int vh_idle_grace_ms;
923 #if defined(LWS_WITH_CACHE_NSCOOKIEJAR) && defined(LWS_WITH_CLIENT)
924 const char *http_nsc_filepath;
927 size_t http_nsc_heap_max_footprint;
930 size_t http_nsc_heap_max_items;
933 size_t http_nsc_heap_max_payload;
938 #if defined(LWS_WITH_SYS_ASYNC_DNS)
939 const char **async_dns_servers;
948 unsigned int win32_connect_check_interval_usec;
1152 char **config_strings,
int *len);
1172 char **config_strings,
int *len);
1340 #define AUTH_MODE_MASK 0xF0000000
const struct lws_protocol_vhost_options * next
const struct lws_protocol_vhost_options * options
LWS_VISIBLE LWS_EXTERN struct lws_vhost * lws_get_vhost(struct lws *wsi)
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_vhosts(struct lws_context *context, struct lws_context_creation_info *info, const char *d, char **config_strings, int *len)
LWS_VISIBLE LWS_EXTERN const char * lws_get_vhost_name(struct lws_vhost *vhost)
LWS_VISIBLE LWS_EXTERN int lws_cmdline_passfail(int argc, const char **argv, int actual)
LWS_VISIBLE LWS_EXTERN void * lws_get_vhost_user(struct lws_vhost *vhost)
LWS_VISIBLE LWS_EXTERN const char * lws_vh_tag(struct lws_vhost *vh)
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_set_proxy(struct lws_vhost *vhost, const char *proxy)
LWS_VISIBLE LWS_EXTERN void lws_default_loop_exit(struct lws_context *cx)
LWS_VISIBLE LWS_EXTERN const char * lws_get_vhost_iface(struct lws_vhost *vhost)
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 int lws_set_socks(struct lws_vhost *vhost, const char *socks)
LWS_VISIBLE LWS_EXTERN struct lws_context * lws_create_context(const struct lws_context_creation_info *info)
LWS_VISIBLE LWS_EXTERN int lws_get_vhost_port(struct lws_vhost *vhost)
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 void lws_vhost_destroy(struct lws_vhost *vh)
LWS_VISIBLE LWS_EXTERN void * lws_vhost_user(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 void * lws_context_user(struct lws_context *context)
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)
int(* lws_context_ready_cb_t)(struct lws_context *context)
const struct lws_http_mount * mount_next
const struct lws_protocol_vhost_options * interpret
const char * basic_auth_login_file
const struct lws_protocol_vhost_options * extra_mimetypes
unsigned char origin_protocol
unsigned int cache_reusable
unsigned int cache_intermediaries
unsigned char mountpoint_len
unsigned int cache_revalidate
const struct lws_protocol_vhost_options * cgienv
LWS_VISIBLE LWS_EXTERN void lws_vhost_set_mounts(struct lws_vhost *v, const struct lws_http_mount *mounts)
@ LWSAUTHM_BASIC_AUTH_CALLBACK
int(* lws_smd_notification_cb_t)(void *opaque, lws_smd_class_t _class, lws_usec_t timestamp, void *buf, size_t len)
const lws_system_ops_t * system_ops
const struct lws_plugin_evlib * event_lib_custom
void(* finalize)(struct lws_vhost *vh, void *arg)
unsigned int fd_limit_per_thread
const char * listen_accept_protocol
const struct lws_protocols ** pprotocols
struct lws_context ** pcontext
unsigned int pt_serv_buf_size
lws_sockfd_type vh_listen_sockfd
const char * listen_accept_role
const lws_retry_bo_t * retry_and_idle_policy
void * external_baggage_free_on_destroy
const char * unix_socket_perms
void(* signal_cb)(void *event_lib_handle, int signum)
unsigned int count_threads