libwebsockets
Lightweight C library for HTML5 websockets
lws_client_connect_info Struct Reference

#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_tretry_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_tlog_cx
 
void * _unused [4]
 

Detailed Description

struct lws_client_connect_info - parameters to connect with when using lws_client_connect_via_info()

Field Documentation

◆ _unused

void* lws_client_connect_info::_unused[4]

dummy

◆ address

const char* lws_client_connect_info::address

remote address to connect to

◆ alpn

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

◆ client_exts

const void* lws_client_connect_info::client_exts

UNUSED... provide in info.extensions at context creation time

◆ context

struct lws_context* lws_client_connect_info::context

lws context to create connection in

◆ fi_wsi_name

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.

◆ host

const char* lws_client_connect_info::host

content of host header

◆ ietf_version_or_minus_one

int lws_client_connect_info::ietf_version_or_minus_one

deprecated: currently leave at 0 or -1

◆ iface

const char* lws_client_connect_info::iface

NULL to allow routing on any interface, or interface name or IP to bind the socket to

◆ keep_warm_secs

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.

◆ local_protocol_name

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

◆ log_cx

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.

◆ manual_initial_tx_credit

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.

◆ method

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.

◆ opaque_user_data

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.

◆ origin

const char* lws_client_connect_info::origin

content of origin header

◆ parent_wsi

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.

◆ path

const char* lws_client_connect_info::path

URI path. Prefix with + for a UNIX socket. (+@ for a Linux abstract-namespace socket)

◆ port

int lws_client_connect_info::port

remote port to connect to

◆ priority

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.

◆ protocol

const char* lws_client_connect_info::protocol

list of ws protocols we could accept

◆ pwsi

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.

◆ retry_and_idle_policy

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.

◆ seq

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.

◆ ssl_connection

int lws_client_connect_info::ssl_connection

0, or a combination of LCCSCF_ flags

◆ sys_tls_client_cert

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.

◆ uri_replace_from

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

◆ uri_replace_to

const char* lws_client_connect_info::uri_replace_to

see uri_replace_from

◆ userdata

void* lws_client_connect_info::userdata

if non-NULL, use this as wsi user_data instead of malloc it

◆ vhost

struct lws_vhost* lws_client_connect_info::vhost

vhost to bind to (used to determine related SSL_CTX)


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