libwebsockets
Lightweight C library for HTML5 websockets
lws_context_creation_info Struct Reference

#include <lws-context-vhost.h>

Data Fields

int port
 
const char * iface
 
const struct lws_protocolsprotocols
 
const struct lws_extensionextensions
 
const struct lws_token_limitstoken_limits
 
const char * ssl_private_key_password
 
const char * ssl_cert_filepath
 
const char * ssl_private_key_filepath
 
const char * ssl_ca_filepath
 
const char * ssl_cipher_list
 
const char * http_proxy_address
 
unsigned int http_proxy_port
 
int gid
 
int uid
 
uint64_t options
 
void * user
 
int ka_time
 
int ka_probes
 
int ka_interval
 
void * provided_client_ssl_ctx
 
unsigned short max_http_header_data
 
unsigned short max_http_header_pool
 
unsigned int count_threads
 
unsigned int fd_limit_per_thread
 
unsigned int timeout_secs
 
const char * ecdh_curve
 
const char * vhost_name
 
const char *const * plugin_dirs
 
const struct lws_protocol_vhost_optionspvo
 
int keepalive_timeout
 
const char * log_filepath
 
const struct lws_http_mountmounts
 
const char * server_string
 
unsigned int pt_serv_buf_size
 
unsigned int max_http_header_data2
 
long ssl_options_set
 
long ssl_options_clear
 
unsigned short ws_ping_pong_interval
 
const struct lws_protocol_vhost_optionsheaders
 
const struct lws_protocol_vhost_optionsreject_service_keywords
 
void * external_baggage_free_on_destroy
 
const char * client_ssl_private_key_password
 
const char * client_ssl_cert_filepath
 
const void * client_ssl_cert_mem
 
unsigned int client_ssl_cert_mem_len
 
const char * client_ssl_private_key_filepath
 
const char * client_ssl_ca_filepath
 
const void * client_ssl_ca_mem
 
unsigned int client_ssl_ca_mem_len
 
const char * client_ssl_cipher_list
 
const struct lws_plat_file_opsfops
 
int simultaneous_ssl_restriction
 
const char * socks_proxy_address
 
unsigned int socks_proxy_port
 
int bind_iface
 
int ssl_info_event_mask
 
unsigned int timeout_secs_ah_idle
 
unsigned short ip_limit_ah
 
unsigned short ip_limit_wsi
 
uint32_t http2_settings [7]
 
const char * error_document_404
 
const char * alpn
 
void ** foreign_loops
 
void(* signal_cb )(void *event_lib_handle, int signum)
 
struct lws_context ** pcontext
 
void(* finalize )(struct lws_vhost *vh, void *arg)
 
void * finalize_arg
 
unsigned int max_http_header_pool2
 
long ssl_client_options_set
 
long ssl_client_options_clear
 
const char * tls1_3_plus_cipher_list
 
const char * client_tls_1_3_plus_cipher_list
 
const char * listen_accept_role
 
const char * listen_accept_protocol
 
const struct lws_protocols ** pprotocols
 
const void * server_ssl_cert_mem
 
unsigned int server_ssl_cert_mem_len
 
const void * server_ssl_private_key_mem
 
unsigned int server_ssl_private_key_mem_len
 
const void * server_ssl_ca_mem
 
unsigned int server_ssl_ca_mem_len
 
const char * username
 
const char * groupname
 
const char * unix_socket_perms
 
const lws_system_ops_tsystem_ops
 
det_lat_buf_cb_t detailed_latency_cb
 
const char * detailed_latency_filepath
 
const lws_retry_bo_tretry_and_idle_policy
 
lws_state_notify_link_t *const * register_notifier_list
 
uint8_t udp_loss_sim_tx_pc
 
uint8_t udp_loss_sim_rx_pc
 
const char * pss_policies_json
 
const struct lws_ss_plugin ** pss_plugins
 
void * _unused [4]
 

Detailed Description

struct lws_context_creation_info - parameters to create context and /or vhost with

This is also used to create vhosts.... if LWS_SERVER_OPTION_EXPLICIT_VHOSTS is not given, then for backwards compatibility one vhost is created at context-creation time using the info from this struct.

If LWS_SERVER_OPTION_EXPLICIT_VHOSTS is given, then no vhosts are created at the same time as the context, they are expected to be created afterwards.

Field Documentation

◆ _unused

void* lws_context_creation_info::_unused[4]

dummy

◆ alpn

const char* lws_context_creation_info::alpn

CONTEXT: If non-NULL, default list of advertised alpn, comma- separated

VHOST: If non-NULL, per-vhost list of advertised alpn, comma- separated

◆ bind_iface

int lws_context_creation_info::bind_iface

VHOST: nonzero to strictly bind sockets to the interface name in .iface (eg, "eth2"), using SO_BIND_TO_DEVICE.

Requires SO_BINDTODEVICE support from your OS and CAP_NET_RAW capability.

Notice that common things like access network interface IP from your local machine use your lo / loopback interface and will be disallowed by this.

◆ client_ssl_ca_filepath

const char* lws_context_creation_info::client_ssl_ca_filepath

VHOST: Client SSL context init: CA certificate filepath or NULL

◆ client_ssl_ca_mem

const void* lws_context_creation_info::client_ssl_ca_mem

VHOST: Client SSL context init: CA certificate memory buffer or NULL... use this to load CA cert from memory instead of file

◆ client_ssl_ca_mem_len

unsigned int lws_context_creation_info::client_ssl_ca_mem_len

VHOST: Client SSL context init: length of client_ssl_ca_mem in bytes

◆ client_ssl_cert_filepath

const char* lws_context_creation_info::client_ssl_cert_filepath

VHOST: Client SSL context init: The certificate the client should present to the peer on connection

◆ client_ssl_cert_mem

const void* lws_context_creation_info::client_ssl_cert_mem

VHOST: Client SSL context init: client certificate memory buffer or NULL... use this to load client cert from memory instead of file

◆ client_ssl_cert_mem_len

unsigned int lws_context_creation_info::client_ssl_cert_mem_len

VHOST: Client SSL context init: length of client_ssl_cert_mem in bytes

◆ client_ssl_cipher_list

const char* lws_context_creation_info::client_ssl_cipher_list

VHOST: Client SSL context init: List of valid ciphers to use (eg, "RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL" or you can leave it as NULL to get "DEFAULT"

◆ client_ssl_private_key_filepath

const char* lws_context_creation_info::client_ssl_private_key_filepath

VHOST: Client SSL context init: filepath to client private key if this is set to NULL but client_ssl_cert_filepath is set, you can handle the LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS callback of protocols[0] to allow setting of the private key directly via tls library calls

◆ client_ssl_private_key_password

const char* lws_context_creation_info::client_ssl_private_key_password

VHOST: Client SSL context init: NULL or the passphrase needed for the private key

◆ client_tls_1_3_plus_cipher_list

const char* lws_context_creation_info::client_tls_1_3_plus_cipher_list

VHOST: List of valid ciphers to use for outgoing client connections ON TLS1.3 AND ABOVE on this vhost (eg, "TLS_CHACHA20_POLY1305_SHA256") or you can leave it as NULL to get "DEFAULT".

◆ count_threads

unsigned int lws_context_creation_info::count_threads

CONTEXT: how many contexts to create in an array, 0 = 1

◆ detailed_latency_cb

det_lat_buf_cb_t lws_context_creation_info::detailed_latency_cb

CONTEXT: NULL, or callback to receive detailed latency information collected for each read and write

◆ detailed_latency_filepath

const char* lws_context_creation_info::detailed_latency_filepath

CONTEXT: NULL, or filepath to put latency data into

◆ ecdh_curve

const char* lws_context_creation_info::ecdh_curve

VHOST: if NULL, defaults to initializing server with "prime256v1"

◆ error_document_404

const char* lws_context_creation_info::error_document_404

VHOST: If non-NULL, when asked to serve a non-existent file, lws attempts to server this url path instead. Eg, "/404.html"

◆ extensions

const struct lws_extension* lws_context_creation_info::extensions

VHOST: NULL or array of lws_extension structs listing the extensions this context supports.

◆ external_baggage_free_on_destroy

void* lws_context_creation_info::external_baggage_free_on_destroy

CONTEXT: NULL, or pointer to something externally malloc'd, that should be freed when the context is destroyed. This allows you to automatically sync the freeing action to the context destruction action, so there is no need for an external free() if the context succeeded to create.

◆ fd_limit_per_thread

unsigned int lws_context_creation_info::fd_limit_per_thread

CONTEXT: nonzero means restrict each service thread to this many fds, 0 means the default which is divide the process fd limit by the number of threads.

Note if this is nonzero, and fd_limit_per_thread multiplied by the number of service threads is less than the process ulimit, then lws restricts internal lookup table allocation to the smaller size, and switches to a less efficient lookup scheme. You should use this to trade off speed against memory usage if you know the lws context will only use a handful of fds.

Bear in mind lws may use some fds internally, for example for the cancel pipe, so you may need to allow for some extras for normal operation.

◆ finalize

void(* lws_context_creation_info::finalize) (struct lws_vhost *vh, void *arg)

VHOST: NULL, or pointer to function that will be called back when the vhost is just about to be freed. The arg parameter will be set to whatever finalize_arg is below.

◆ finalize_arg

void* lws_context_creation_info::finalize_arg

VHOST: opaque pointer lws ignores but passes to the finalize callback. If you don't care, leave it NULL.

◆ fops

const struct lws_plat_file_ops* lws_context_creation_info::fops

CONTEXT: NULL, or pointer to an array of fops structs, terminated by a sentinel with NULL .open.

If NULL, lws provides just the platform file operations struct for backwards compatibility.

◆ foreign_loops

void** lws_context_creation_info::foreign_loops

CONTEXT: This is ignored if the context is not being started with an event loop, ie, .options has a flag like LWS_SERVER_OPTION_LIBUV.

NULL indicates lws should start its own even loop for each service thread, and deal with closing the loops when the context is destroyed.

Non-NULL means it points to an array of external ("foreign") event loops that are to be used in turn for each service thread. In the default case of 1 service thread, it can just point to one foreign event loop.

◆ gid

int lws_context_creation_info::gid

CONTEXT: group id to change to after setting listen socket, or -1. See also .username below.

◆ groupname

const char* lws_context_creation_info::groupname

CONTEXT: string groupname for post-init permissions. Like .gid but takes a string groupname.

◆ headers

const struct lws_protocol_vhost_options* lws_context_creation_info::headers

VHOST: pointer to optional linked list of per-vhost canned headers that are added to server responses

◆ http2_settings

uint32_t lws_context_creation_info::http2_settings[7]

VHOST: if http2_settings[0] is nonzero, the values given in http2_settings[1]..[6] are used instead of the lws platform default values. Just leave all at 0 if you don't care.

◆ http_proxy_address

const char* lws_context_creation_info::http_proxy_address

VHOST: If non-NULL, attempts to proxy via the given address. If proxy auth is required, use format "username:password\@server:port"

◆ http_proxy_port

unsigned int lws_context_creation_info::http_proxy_port

VHOST: If http_proxy_address was non-NULL, uses this port

◆ iface

const char* lws_context_creation_info::iface

VHOST: NULL to bind the listen socket to all interfaces, or the interface name, eg, "eth2" If options specifies LWS_SERVER_OPTION_UNIX_SOCK, this member is the pathname of a UNIX domain socket. you can use the UNIX domain sockets in abstract namespace, by prepending an at symbol to the socket name.

◆ ip_limit_ah

unsigned short lws_context_creation_info::ip_limit_ah

CONTEXT: max number of ah a single IP may use simultaneously 0 is no limit. This is a soft limit: if the limit is reached, connections from that IP will wait in the ah waiting list and not be able to acquire an ah until a connection belonging to the IP relinquishes one it already has.

◆ ip_limit_wsi

unsigned short lws_context_creation_info::ip_limit_wsi

CONTEXT: max number of wsi a single IP may use simultaneously. 0 is no limit. This is a hard limit, connections from the same IP will simply be dropped once it acquires the amount of simultaneous wsi / accepted connections given here.

◆ ka_interval

int lws_context_creation_info::ka_interval

CONTEXT: if ka_time was nonzero, how long to wait before each ka_probes attempt

◆ ka_probes

int lws_context_creation_info::ka_probes

CONTEXT: if ka_time was nonzero, after the timeout expires how many times to try to get a response from the peer before giving up and killing the connection

◆ ka_time

int lws_context_creation_info::ka_time

CONTEXT: 0 for no TCP keepalive, otherwise apply this keepalive timeout to all libwebsocket sockets, client or server

◆ keepalive_timeout

int lws_context_creation_info::keepalive_timeout

VHOST: (default = 0 = 5s, 31s for http/2) seconds to allow remote client to hold on to an idle HTTP/1.1 connection. Timeout lifetime applied to idle h2 network connections

◆ listen_accept_protocol

const char* lws_context_creation_info::listen_accept_protocol

VHOST: NULL for default, or force accepted incoming connections to bind to this vhost protocol name.

◆ listen_accept_role

const char* lws_context_creation_info::listen_accept_role

VHOST: NULL for default, or force accepted incoming connections to bind to this role. Uses the role names from their ops struct, eg, "raw-skt".

◆ log_filepath

const char* lws_context_creation_info::log_filepath

VHOST: filepath to append logs to... this is opened before any dropping of initial privileges

◆ max_http_header_data

unsigned short lws_context_creation_info::max_http_header_data

CONTEXT: The max amount of header payload that can be handled in an http request (unrecognized header payload is dropped)

◆ max_http_header_data2

unsigned int lws_context_creation_info::max_http_header_data2

CONTEXT: if max_http_header_data is 0 and this is nonzero, this will be used in place of the default. It's like this for compatibility with the original short version, this is unsigned int length.

◆ max_http_header_pool

unsigned short lws_context_creation_info::max_http_header_pool

CONTEXT: The max number of connections with http headers that can be processed simultaneously (the corresponding memory is allocated and deallocated dynamically as needed). If the pool is fully busy new incoming connections must wait for accept until one becomes free. 0 = allow as many ah as number of availble fds for the process

◆ max_http_header_pool2

unsigned int lws_context_creation_info::max_http_header_pool2

CONTEXT: if max_http_header_pool is 0 and this is nonzero, this will be used in place of the default. It's like this for compatibility with the original short version: this is unsigned int length.

◆ mounts

const struct lws_http_mount* lws_context_creation_info::mounts

VHOST: optional linked list of mounts for this vhost

◆ options

uint64_t lws_context_creation_info::options

VHOST + CONTEXT: 0, or LWS_SERVER_OPTION_... bitfields

◆ pcontext

struct lws_context** lws_context_creation_info::pcontext

CONTEXT: if non-NULL, at the end of context destroy processing, the pointer pointed to by pcontext is written with NULL. You can use this to let foreign event loops know that lws context destruction is fully completed.

◆ plugin_dirs

const char* const* lws_context_creation_info::plugin_dirs

CONTEXT: NULL, or NULL-terminated array of directories to scan for lws protocol plugins at context creation time

◆ port

int lws_context_creation_info::port

VHOST: Port to listen on. Use CONTEXT_PORT_NO_LISTEN to suppress listening for a client. Use CONTEXT_PORT_NO_LISTEN_SERVER if you are writing a server but you are using Socket adoption helpers instead of the built-in listener.

You can also set port to 0, in which case the kernel will pick a random port that is not already in use. You can find out what port the vhost is listening on using lws_get_vhost_listen_port()

◆ pprotocols

const struct lws_protocols** lws_context_creation_info::pprotocols

VHOST: NULL: use .protocols, otherwise ignore .protocols and use this array of pointers to protocols structs. The end of the array is marked by a NULL pointer.

This is preferred over .protocols, because it allows the protocol struct to be opaquely defined elsewhere, with just a pointer to it needed to create the context with it. .protocols requires also the type of the user data to be known so its size can be given.

◆ protocols

const struct lws_protocols* lws_context_creation_info::protocols

VHOST: Array of structures listing supported protocols and a protocol-specific callback for each one. The list is ended with an entry that has a NULL callback pointer. SEE ALSO .pprotocols below, which gives an alternative way to provide an array of pointers to protocol structs.

◆ provided_client_ssl_ctx

void* lws_context_creation_info::provided_client_ssl_ctx

dummy if ssl disabled

◆ pss_plugins

const struct lws_ss_plugin** lws_context_creation_info::pss_plugins

CONTEXT: point to an array of pointers to plugin structs here, terminated with a NULL ptr. Set to NULL if not using Secure Streams.

◆ pss_policies_json

const char* lws_context_creation_info::pss_policies_json

CONTEXT: point to a string containing a JSON description of the secure streams policies. Set to NULL if not using Secure Streams.

◆ pt_serv_buf_size

unsigned int lws_context_creation_info::pt_serv_buf_size

CONTEXT: 0 = default of 4096. This buffer is used by various service related features including file serving, it defines the max chunk of file that can be sent at once. At the risk of lws having to buffer failed large sends, it can be increased to, eg, 128KiB to improve throughput.

◆ pvo

const struct lws_protocol_vhost_options* lws_context_creation_info::pvo

VHOST: pointer to optional linked list of per-vhost options made accessible to protocols

◆ register_notifier_list

lws_state_notify_link_t* const* lws_context_creation_info::register_notifier_list

CONTEXT: NULL, or pointer to an array of notifiers that should be registered during context creation, so they can see state change events from very early on. The array should end with a NULL.

◆ reject_service_keywords

const struct lws_protocol_vhost_options* lws_context_creation_info::reject_service_keywords

CONTEXT: Optional list of keywords and rejection codes + text.

The keywords are checked for existing in the user agent string.

Eg, "badrobot" "404 Not Found"

◆ retry_and_idle_policy

const lws_retry_bo_t* lws_context_creation_info::retry_and_idle_policy

VHOST: optional retry and idle policy to apply to this vhost. Currently only the idle parts are applied to the connections.

◆ server_ssl_ca_mem

const void* lws_context_creation_info::server_ssl_ca_mem

VHOST: Alternative for ssl_ca_filepath allowing init from a CA cert in memory instead of a file. At most one of ssl_ca_filepath or server_ssl_ca_mem should be non-NULL.

◆ server_ssl_ca_mem_len

unsigned int lws_context_creation_info::server_ssl_ca_mem_len

VHOST: length of server_ssl_ca_mem in memory

◆ server_ssl_cert_mem

const void* lws_context_creation_info::server_ssl_cert_mem

VHOST: Alternative for ssl_cert_filepath that allows setting from memory instead of from a file. At most one of ssl_cert_filepath or server_ssl_cert_mem should be non-NULL.

◆ server_ssl_cert_mem_len

unsigned int lws_context_creation_info::server_ssl_cert_mem_len

VHOST: Server SSL context init: length of server_ssl_cert_mem in bytes

◆ server_ssl_private_key_mem

const void* lws_context_creation_info::server_ssl_private_key_mem

VHOST: Alternative for ssl_private_key_filepath allowing init from a private key in memory instead of a file. At most one of ssl_private_key_filepath or server_ssl_private_key_mem should be non-NULL.

◆ server_ssl_private_key_mem_len

unsigned int lws_context_creation_info::server_ssl_private_key_mem_len

VHOST: length of server_ssl_private_key_mem in memory

◆ server_string

const char* lws_context_creation_info::server_string

CONTEXT: string used in HTTP headers to identify server software, if NULL, "libwebsockets".

◆ signal_cb

void(* lws_context_creation_info::signal_cb) (void *event_lib_handle, int signum)

CONTEXT: NULL: default signal handling. Otherwise this receives the signal handler callback. event_lib_handle is the native event library signal handle, eg uv_signal_t * for libuv.

◆ simultaneous_ssl_restriction

int lws_context_creation_info::simultaneous_ssl_restriction

CONTEXT: 0 (no limit) or limit of simultaneous SSL sessions possible.

◆ socks_proxy_address

const char* lws_context_creation_info::socks_proxy_address

VHOST: If non-NULL, attempts to proxy via the given address. If proxy auth is required, use format "username:password\@server:port"

◆ socks_proxy_port

unsigned int lws_context_creation_info::socks_proxy_port

VHOST: If socks_proxy_address was non-NULL, uses this port

◆ ssl_ca_filepath

const char* lws_context_creation_info::ssl_ca_filepath

VHOST: CA certificate filepath or NULL. (For backwards compatibility, this can also be used to pass the client CA filepath when setting up a vhost client SSL context, but it is preferred to use .client_ssl_ca_filepath for that.)

Notice you can alternatively set a DER or PEM CA cert from a memory buffer using server_ssl_ca_mem and server_ssl_ca_mem_len.

◆ ssl_cert_filepath

const char* lws_context_creation_info::ssl_cert_filepath

VHOST: If libwebsockets was compiled to use ssl, and you want to listen using SSL, set to the filepath to fetch the server cert from, otherwise NULL for unencrypted. (For backwards compatibility, this can also be used to pass the client certificate when setting up a vhost client SSL context, but it is preferred to use .client_ssl_cert_filepath for that.)

Notice you can alternatively set a single DER or PEM from a memory buffer as the vhost tls cert using server_ssl_cert_mem and server_ssl_cert_mem_len.

◆ ssl_cipher_list

const char* lws_context_creation_info::ssl_cipher_list

VHOST: List of valid ciphers to use ON TLS1.2 AND LOWER ONLY (eg, "RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL" or you can leave it as NULL to get "DEFAULT" (For backwards compatibility, this can also be used to pass the client cipher list when setting up a vhost client SSL context, but it is preferred to use .client_ssl_cipher_list for that.) SEE .tls1_3_plus_cipher_list and .client_tls_1_3_plus_cipher_list for the equivalent for tls1.3.

◆ ssl_client_options_clear

long lws_context_creation_info::ssl_client_options_clear

VHOST: Any bits set here will be cleared as CLIENT SSL options

◆ ssl_client_options_set

long lws_context_creation_info::ssl_client_options_set

VHOST: Any bits set here will be set as CLIENT SSL options

◆ ssl_info_event_mask

int lws_context_creation_info::ssl_info_event_mask

VHOST: mask of ssl events to be reported on LWS_CALLBACK_SSL_INFO callback for connections on this vhost. The mask values are of the form SSL_CB_ALERT, defined in openssl/ssl.h. The default of 0 means no info events will be reported.

◆ ssl_options_clear

long lws_context_creation_info::ssl_options_clear

VHOST: Any bits set here will be cleared as server SSL options

◆ ssl_options_set

long lws_context_creation_info::ssl_options_set

VHOST: Any bits set here will be set as server SSL options

◆ ssl_private_key_filepath

const char* lws_context_creation_info::ssl_private_key_filepath

VHOST: filepath to private key if wanting SSL mode; if this is set to NULL but ssl_cert_filepath is set, the OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY callback is called to allow setting of the private key directly via openSSL library calls. (For backwards compatibility, this can also be used to pass the client cert private key filepath when setting up a vhost client SSL context, but it is preferred to use .client_ssl_private_key_filepath for that.)

Notice you can alternatively set a DER or PEM private key from a memory buffer as the vhost tls private key using server_ssl_private_key_mem and server_ssl_private_key_mem_len.

◆ ssl_private_key_password

const char* lws_context_creation_info::ssl_private_key_password

VHOST: NULL or the passphrase needed for the private key. (For backwards compatibility, this can also be used to pass the client cert passphrase when setting up a vhost client SSL context, but it is preferred to use .client_ssl_private_key_password for that.)

◆ system_ops

const lws_system_ops_t* lws_context_creation_info::system_ops

CONTEXT: hook up lws_system_ apis to system-specific implementations

◆ timeout_secs

unsigned int lws_context_creation_info::timeout_secs

VHOST: various processes involving network roundtrips in the library are protected from hanging forever by timeouts. If nonzero, this member lets you set the timeout used in seconds. Otherwise a default timeout is used.

◆ timeout_secs_ah_idle

unsigned int lws_context_creation_info::timeout_secs_ah_idle

VHOST: seconds to allow a client to hold an ah without using it. 0 defaults to 10s.

◆ tls1_3_plus_cipher_list

const char* lws_context_creation_info::tls1_3_plus_cipher_list

VHOST: List of valid ciphers to use for incoming server connections ON TLS1.3 AND ABOVE (eg, "TLS_CHACHA20_POLY1305_SHA256" on this vhost or you can leave it as NULL to get "DEFAULT". SEE .client_tls_1_3_plus_cipher_list to do the same on the vhost client SSL_CTX.

◆ token_limits

const struct lws_token_limits* lws_context_creation_info::token_limits

CONTEXT: NULL or struct lws_token_limits pointer which is initialized with a token length limit for each possible WSI_TOKEN_

◆ udp_loss_sim_rx_pc

uint8_t lws_context_creation_info::udp_loss_sim_rx_pc

CONTEXT: percentage of udp reads we actually received to make disappear, in order to simulate and test udp retry flow

◆ udp_loss_sim_tx_pc

uint8_t lws_context_creation_info::udp_loss_sim_tx_pc

CONTEXT: percentage of udp writes we could have performed to instead not do, in order to simulate and test udp retry flow

◆ uid

int lws_context_creation_info::uid

CONTEXT: user id to change to after setting listen socket, or -1. See also .groupname below.

◆ unix_socket_perms

const char* lws_context_creation_info::unix_socket_perms

VHOST: if your vhost is listening on a unix socket, you can give a "username:groupname" string here to control the owner:group it's created with. It's always created with 0660 mode.

◆ user

void* lws_context_creation_info::user

VHOST + CONTEXT: optional user pointer that will be associated with the context when creating the context (and can be retrieved by lws_context_user(context), or with the vhost when creating the vhost (and can be retrieved by lws_vhost_user(vhost)). You will need to use LWS_SERVER_OPTION_EXPLICIT_VHOSTS and create the vhost separately if you care about giving the context and vhost different user pointer values.

◆ username

const char* lws_context_creation_info::username

CONTEXT: string username for post-init permissions. Like .uid but takes a string username.

◆ vhost_name

const char* lws_context_creation_info::vhost_name

VHOST: name of vhost, must match external DNS name used to access the site, like "warmcat.com" as it's used to match Host: header and / or SNI name for SSL.

◆ ws_ping_pong_interval

unsigned short lws_context_creation_info::ws_ping_pong_interval

CONTEXT: 0 for none, else interval in seconds between sending PINGs on idle websocket connections. When the PING is sent, the PONG must come within the normal timeout_secs timeout period or the connection will be dropped. Any RX or TX traffic on the connection restarts the interval timer, so a connection which always sends or receives something at intervals less than the interval given here will never send PINGs / expect PONGs. Conversely as soon as the ws connection is established, an idle connection will do the PING / PONG roundtrip as soon as ws_ping_pong_interval seconds has passed without traffic


The documentation for this struct was generated from the following file: