They each append to a buffer taking care about the buffer end, which is passed in as a pointer. When data is written to the buffer, the current position p is updated accordingly.
All of these apis are LWS_WARN_UNUSED_RESULT as they can run out of space and fail with nonzero return.
For URL arguments, each argument is stored urldecoded in a "fragment", so you can use the fragment-aware api lws_hdr_copy_fragment() to access each argument in turn: the fragments contain urldecoded strings like x=1 or y=2.
As a convenience, lws has an api that will find the fragment with a given name= part, lws_get_urlarg_by_name().
A list of protocols can be passed in at context creation time, but it is also legal to leave that NULL and add the protocols and their callback code using plugins.
Plugins are much preferable compared to cut and pasting code into an application each time, since they can be used standalone.
When lws cannot complete your send at the time, it will buffer the data and send it in the background, suppressing any further WRITEABLE callbacks on that connection until it completes. So it is important to write new things in a new writeable callback.
These apis reflect the various ways we can indicate we would like to be called back when one or more connections is writeable.
enum lws_client_connect_ssl_connection_flags - flags that may be used with struct lws_client_connect_info ssl_connection member to control if and how SSL checks apply to the client connection being created
LWS requires that there is one context, in which you may define multiple vhosts. Each vhost is a virtual host, with either its own listen port or sharing an existing one. Each vhost has its own SSL context that can be set up individually or left disabled.
If you don't care about multiple "site" support, you can ignore it and lws will create a single default vhost at context creation time.
(VH) Don't allow the connection unless the client has a client cert that we recognize; provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
-
LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME
-
(CTX) Don't try to get the server's hostname
+
LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME
(CTX) Don't try to get the server's hostname
-
LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT
-
(VH) Allow non-SSL (plaintext) connections on the same port as SSL is listening... undermines the security of SSL; provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
+
LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT
(VH) Allow non-SSL (plaintext) connections on the same port as SSL is listening... undermines the security of SSL; provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
-
LWS_SERVER_OPTION_LIBEV
-
(CTX) Use libev event loop
+
LWS_SERVER_OPTION_LIBEV
(CTX) Use libev event loop
-
LWS_SERVER_OPTION_DISABLE_IPV6
-
(VH) Disable IPV6 support
+
LWS_SERVER_OPTION_DISABLE_IPV6
(VH) Disable IPV6 support
-
LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS
-
(VH) Don't load OS CA certs, you will need to load your own CA cert(s)
+
LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS
(VH) Don't load OS CA certs, you will need to load your own CA cert(s)
-
LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED
-
(VH) Accept connections with no valid Cert (eg, selfsigned)
+
LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED
(VH) Accept connections with no valid Cert (eg, selfsigned)
-
LWS_SERVER_OPTION_VALIDATE_UTF8
-
(VH) Check UT-8 correctness
+
LWS_SERVER_OPTION_VALIDATE_UTF8
(VH) Check UT-8 correctness
-
LWS_SERVER_OPTION_SSL_ECDH
-
(VH) initialize ECDH ciphers
+
LWS_SERVER_OPTION_SSL_ECDH
(VH) initialize ECDH ciphers
-
LWS_SERVER_OPTION_LIBUV
-
(CTX) Use libuv event loop
+
LWS_SERVER_OPTION_LIBUV
(CTX) Use libuv event loop
-
LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS
-
(VH) Use http redirect to force http to https (deprecated: use mount redirection)
+
LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS
(VH) Use http redirect to force http to https (deprecated: use mount redirection)
-
LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
-
(CTX) Initialize the SSL library at all
+
LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
(CTX) Initialize the SSL library at all
-
LWS_SERVER_OPTION_EXPLICIT_VHOSTS
-
(CTX) Only create the context when calling context create api, implies user code will create its own vhosts
+
LWS_SERVER_OPTION_EXPLICIT_VHOSTS
(CTX) Only create the context when calling context create api, implies user code will create its own vhosts
-
LWS_SERVER_OPTION_UNIX_SOCK
-
(VH) Use Unix socket
+
LWS_SERVER_OPTION_UNIX_SOCK
(VH) Use Unix socket
-
LWS_SERVER_OPTION_STS
-
(VH) Send Strict Transport Security header, making clients subsequently go to https even if user asked for http
+
LWS_SERVER_OPTION_STS
(VH) Send Strict Transport Security header, making clients subsequently go to https even if user asked for http
-
LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY
-
(VH) Enable LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE to take effect
+
LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY
(VH) Enable LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE to take effect
-
LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE
-
(VH) if set, only ipv6 allowed on the vhost
+
LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE
(VH) if set, only ipv6 allowed on the vhost
-
LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN
-
(CTX) Libuv only: Do not spin on SIGSEGV / SIGFPE. A segfault normally makes the lib spin so you can attach a debugger to it even if it happened without a debugger in place. You can disable that by giving this option.
+
LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN
(CTX) Libuv only: Do not spin on SIGSEGV / SIGFPE. A segfault normally makes the lib spin so you can attach a debugger to it even if it happened without a debugger in place. You can disable that by giving this option.
You feed it a list of parameter names and it creates pointers to the urldecoded arguments: file upload parameters pass the file data in chunks to a user-supplied callback as they come.
Since it's stateful, it handles the incoming data needing more than one POST_BODY callback and has no limit on uploaded file size.