libwebsockets
Lightweight C library for HTML5 websockets
|
#include <lws-client.h>
Data Fields | |
struct lws_context * | context |
const char * | address |
int | port |
int | ssl_connection |
const char * | path |
const char * | host |
const char * | origin |
const char * | protocol |
int | ietf_version_or_minus_one |
void * | userdata |
const void * | client_exts |
const char * | method |
struct lws * | parent_wsi |
const char * | uri_replace_from |
const char * | uri_replace_to |
struct lws_vhost * | vhost |
struct lws ** | pwsi |
const char * | iface |
const char * | local_protocol_name |
const char * | alpn |
struct lws_sequencer * | seq |
void * | opaque_user_data |
const lws_retry_bo_t * | retry_and_idle_policy |
int | manual_initial_tx_credit |
uint8_t | sys_tls_client_cert |
uint8_t | priority |
void * | mqtt_cp |
const char * | fi_wsi_name |
uint16_t | keep_warm_secs |
lws_log_cx_t * | log_cx |
void * | _unused [4] |
struct lws_client_connect_info - parameters to connect with when using lws_client_connect_via_info()
void* lws_client_connect_info::_unused[4] |
dummy
const char* lws_client_connect_info::address |
remote address to connect to
const char* lws_client_connect_info::alpn |
NULL: allow lws default ALPN list, from vhost if present or from list of roles built into lws non-NULL: require one from provided comma-separated list of alpn tokens
const void* lws_client_connect_info::client_exts |
UNUSED... provide in info.extensions at context creation time
struct lws_context* lws_client_connect_info::context |
lws context to create connection in
const char* lws_client_connect_info::fi_wsi_name |
specific Fault Injection namespace name for wsi created for this connection, allows targeting by "wsi=XXX/..." if you give XXX here.
const char* lws_client_connect_info::host |
content of host header
int lws_client_connect_info::ietf_version_or_minus_one |
deprecated: currently leave at 0 or -1
const char* lws_client_connect_info::iface |
NULL to allow routing on any interface, or interface name or IP to bind the socket to
uint16_t lws_client_connect_info::keep_warm_secs |
0 means 5s. If the client connection to the endpoint becomes idle, defer closing it for this many seconds in case another outgoing connection to the same endpoint turns up.
const char* lws_client_connect_info::local_protocol_name |
NULL: .protocol is used both to select the local protocol handler to bind to and as the list of remote ws protocols we could accept. non-NULL: this protocol name is used to bind the connection to the local protocol handler. .protocol is used for the list of remote ws protocols we could accept
lws_log_cx_t* lws_client_connect_info::log_cx |
NULL to use lws_context log context, else a pointer to a log context template to take a copy of for this wsi. Used to isolate wsi-specific logs into their own stream or file.
int lws_client_connect_info::manual_initial_tx_credit |
if LCCSCF_H2_MANUAL_REFLOW is set, this becomes the initial tx credit for the stream.
const char* lws_client_connect_info::method |
if non-NULL, do this http method instead of ws[s] upgrade. use "GET" to be a simple http client connection. "RAW" gets you a connected socket that lws itself will leave alone once connected.
void* lws_client_connect_info::opaque_user_data |
This data has no meaning to lws but is applied to the client wsi and can be retrieved by user code with lws_get_opaque_user_data(). It's also provided with sequencer messages if the wsi is bound to an lws_seq_t.
const char* lws_client_connect_info::origin |
content of origin header
struct lws* lws_client_connect_info::parent_wsi |
if another wsi is responsible for this connection, give it here. this is used to make sure if the parent closes so do any child connections first.
const char* lws_client_connect_info::path |
URI path. Prefix with + for a UNIX socket. (+@ for a Linux abstract-namespace socket)
int lws_client_connect_info::port |
remote port to connect to
uint8_t lws_client_connect_info::priority |
0 means normal priority... otherwise sets the IP priority on packets coming from this connection, from 1 - 7. Setting 7 (network management priority) requires CAP_NET_ADMIN capability but the others can be set by anyone.
const char* lws_client_connect_info::protocol |
list of ws protocols we could accept
struct lws** lws_client_connect_info::pwsi |
if not NULL, store the new wsi here early in the connection process. Although we return the new wsi, the call to create the client connection does progress the connection somewhat and may meet an error that will result in the connection being scrubbed and NULL returned. While the wsi exists though, he may process a callback like CLIENT_CONNECTION_ERROR with his wsi: this gives the user callback a way to identify which wsi it is that faced the error even before the new wsi is returned and even if ultimately no wsi is returned.
const lws_retry_bo_t* lws_client_connect_info::retry_and_idle_policy |
optional retry and idle policy to apply to this connection. Currently only the idle parts are applied to the connection.
struct lws_sequencer* lws_client_connect_info::seq |
NULL, or an lws_seq_t that wants to be given messages about this wsi's lifecycle as it connects, errors or closes.
int lws_client_connect_info::ssl_connection |
0, or a combination of LCCSCF_ flags
uint8_t lws_client_connect_info::sys_tls_client_cert |
0 means no client cert. 1+ means apply lws_system client cert 0+ to the client connection.
const char* lws_client_connect_info::uri_replace_from |
if non-NULL, when this string is found in URIs in text/html content-encoding, it's replaced with uri_replace_to
const char* lws_client_connect_info::uri_replace_to |
see uri_replace_from
void* lws_client_connect_info::userdata |
if non-NULL, use this as wsi user_data instead of malloc it
struct lws_vhost* lws_client_connect_info::vhost |
vhost to bind to (used to determine related SSL_CTX)