Lines Matching +full:mount +full:- +full:observe

7 user callback found in test-server.c / test-server-http.c.
34 So it if highly recommended you put your protocol-specific code into the
36 use it dynamically-loaded.
47 - `lws_callback_on_writable(wsi)` for a specific `wsi`, or
49 - `lws_callback_on_writable_all_protocol(protocol)` for all connections
75 You will receive a message about "Illegal back-to-back write of ... detected"
82 and be buffered for completion by lws; it will be auto-completed by the
146 libraries that also take this locking-free, nonblocking event loop approach that
187 This will take a platform-specific action to wake the lws event loop thread wait,
191 message to every vhost-protocol instantiation, so you can handle this callback,
204 it again to re-enable it on the incoming wsi.
228 pvo (per-vhost option) to the
232 * this sets a per-vhost, per-protocol option name:value pair
247 "my-protocol",
258 Will select "my-protocol" from your protocol list (even if it came
264 When you want to close a connection, you do it by returning `-1` from a
268 the wsi, then notice in the callback you want to close it and just return -1.
270 -1 is simple.
287 simply send the gzip-compressed file from inside the zip file with no further
299 `libwebsockets-test-server-v2.0` includes a mount using this technology
303 inside a .zip file in /usr/[local/]share-libwebsockets-test-server/candide.zip
305 Usage is otherwise automatic, if you arrange a mount that points to the zipfile,
306 eg, "/ziptest" -> "mypath/test.zip", then URLs like `/ziptest/index.html` will be
323 if (client->HasFragments()) {
324 client->AppendMessageFragment(in, len, 0);
325 in = (void *)client->GetMessage();
326 len = client->GetMessageLength();
329 client->ProcessMessage((char *)in, len, wsi);
330 client->ResetMessage();
332 client->AppendMessageFragment(in, len, remaining);
337 The test app libwebsockets-test-fraggle sources also show how to
348 Sanitizer, using `cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DLWS_WITH_ASAN=1`. LWS is routinely run durin…
375 So you can let **libwebsockets** try and if `pollfd->revents` is nonzero on return,
382 - be sure you set .events to .revents value as well in the synthesized pollfd
384 - check the built-in support for the event loop if possible (eg, ./lib/libuv.c)
387 - use LWS_POLLHUP / LWS_POLLIN / LWS_POLLOUT from libwebsockets.h to avoid
400 `lws_service_tsi(context, -1, tsi)`, again normally tsi is 0.
408 An example of handling it is shown in the test-server code specific to
417 $ cp test-apps/test-server.c test.cpp
423 $ g++ -DINSTALL_DATADIR=\"/usr/share\" -ocpptest test.cpp -lwebsockets
447 when you want to enable -DLWS_WITH_HTTP2=1.
454 writing bulk data over http/2, you need to observe these rules so that it will
469 - observe the LWS_PRE buffer requirement mentioned above
471 - Use `lws_add_http_header_status()` to add the transaction status (200 etc)
473 - use lws apis `lws_add_http_header_by_name()` and `lws_add_http_header_by_token()`
477 - use the `lws api lws_finalize_http_header()` api after adding the last
480 - write the header using lws_write(..., `LWS_WRITE_HTTP_HEADERS`);
482 3) http/2 introduces per-stream transmit credit... how much more you can send
487 more credit for the stream appears, and lws built-in file serving (via mounts
491 For http/1, it will always return (size_t)-1, ie, no limit.
505 your header name strings to lower-case to be compatible both ways.
507 5) Chunked Transfer-encoding is illegal in http/2, http/2 peers will actively
534 Note that BSDs don't support keepalive time / probes / interval per-socket
544 context-creation time.
549 `"RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL"`
583 After attempting the connection and getting back a non-`NULL` `wsi` you should
586 As usual, see [test-client.c](../test-apps/test-client.c) for example code.
600 @section fileapi Lws platform-independent file access apis
603 both used by user code to make it platform-agnostic, and be overridden or
610 The test server shows how to use it, basically the platform-specific part of
620 and then can use helpers to also leverage these platform-independent
670 1) Pre-2.2 fops directly used platform file descriptors. Current fops returns and accepts a wrappe…
672 2) Pre-2.2 fops bound the fops to a wsi. This is completely removed, you just give a pointer to th…
674 3) Everything is wrapped in typedefs. See lws-plat-unix.c for examples of how to implement.
677 …n must set and manage this generic information now. See the implementations in lws-plat-unix.c for
701 "protocol-name-to-bind-to",
721 The minimal example `raw/minimal-raw-file` demonstrates how to use it.
723 `protocol-lws-raw-test` plugin also provides a method for testing this with
724 `libwebsockets-test-server-v2.0`:
726 The plugin creates a FIFO on your system called "/tmp/lws-test-raw"
731 $ sudo sh -c "echo hello > /tmp/lws-test-raw"
745 `.listen_accept_role` to `"raw-skt"` when creating the vhost.
760 `protocol-lws-raw-test` plugin provides a method for testing this with
761 `libwebsockets-test-server-v2.0`:
763 Run libwebsockets-test-server-v2.0 and connect to it by telnet, eg
784 The libwebsockets-test-client supports this using raw:// URLS. To
788 $ nc -l 9999
794 $ libwebsockets-test-client raw://127.0.0.1:9999
844 cmake .. -DLWS_SSL_SERVER_WITH_ECDH_CERT=1
846 **and** the info->options flag
874 -S -s on `libwebsockets-test-server-v2.0`.
881 very simple to use, libwebsockets-test-server-pthread shows how to do it,
882 use -j n argument there to control the number of service threads up to 32.
901 associated to a specific tsi (Thread Service Index, 0 .. n - 1). See
902 the libwebsockets-test-server-pthread for how to do.
912 using -DLWS_MAX_SMP=, if not given it's set to 1. The serv_buf allocation
919 See the test-server-pthreads.c sample for how to use.
955 -DLWS_WITH_LIBEV=1
956 -DLWS_WITH_LIBUV=1
957 -DLWS_WITH_LIBEVENT=1
959 at cmake configure-time. The user application may use one of the
984 We worked around this problem by disabling -Werror on the parts of lws that
995 User code may set per-connection extension options now, using a new api
1000 lws_set_extension_option(wsi, "permessage-deflate",
1006 just returns -1. Otherwise the connection's extension has its
1010 example above permessage-deflate restricts the size of his rx
1039 int lenx = sizeof(buffer) - LWS_PRE;
1051 return -1;
1052 while (lenx--)
1071 That is fast, but resource-intensive.
1075 first connection that pipelining / keep-alive is supported by the server,
1096 `-DLWS_WITH_HTTP2=1` or giving the `LCCSCF_NOT_H2` flag in the client
1156 a similar way that unix lets you mount filesystems into areas of your /
1180 The last mount structure should have a NULL mount_next, otherwise it should
1181 point to the 'next' mount structure in your list.
1183 Both the mount structures and the strings must persist until the context is
1200 - LWSMPRO_FILE is used for mapping url namespace to a filesystem directory and
1203 - LWSMPRO_CGI associates the url namespace with the given CGI executable, which
1206 - LWSMPRO_REDIR_HTTP and LWSMPRO_REDIR_HTTPS auto-redirect clients to the given
1209 - LWSMPRO_CALLBACK causes the http connection to attach to the callback
1219 in test-server-v2.0.c, the URL area "/formtest" is associated with the plugin
1220 providing "protocol-post-demo" like this
1224 NULL, /* linked-list pointer to next*/
1226 "protocol-post-demo", /* handler */
1244 protocol-post-demo deals with accepting and responding to the html form that
1247 When a connection accesses a URL related to a CALLBACK type mount, the
1249 URL outside the same CALLBACK mount area. User space on the connection is
1272 This Linux-only feature requires SO_BIND_TO_DEVICE, which in turn
1286 $ sudo /usr/local/bin/libwebsockets-test-server -u agreen -i eno1 -k
1306 - include lws-common.js from your HEAD section
1308 \<script src="/lws-common.js">\</script>
1310 - dim the page during initialization, in a script section on your page
1314 - in your ws onOpen(), remove the dimming
1318 - in your ws onClose(), reapply the dimming
1329 `.error_document_404`... if non-null the client is redirected to this string.
1332 the user-selected text message and attempts to pull in `/error.css` for styling.