mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
![]() This adds the option to have lws do its own dns resolution on the event loop, without blocking. Existing implementations get the name resolution done by the libc, which is blocking. In the case you are opening client connections but need to carefully manage latency, another connection opening and doing the name resolution becomes a big problem. Currently it supports - ipv4 / A records - ipv6 / AAAA records - ipv4-over-ipv6 ::ffff:1.2.3.4 A record promotion for ipv6 - only one server supported over UDP :53 - nameserver discovery on linux, windows, freertos It also has some nice advantages - lws-style paranoid response parsing - random unique tid generation to increase difficulty of poisoning - it's really integrated with the lws event loop, it does not spawn threads or use the libc resolver, and of course no blocking at all - platform-specific server address capturing (from /etc/resolv.conf on linux, windows apis on windows) - it has LRU caching - piggybacking (multiple requests before the first completes go on a list on the first request, not spawn multiple requests) - observes TTL in cache - TTL and timeout use lws_sul timers on the event loop - ipv6 pieces only built if cmake LWS_IPV6 enabled |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
minimal-http-client-multi.c | ||
README.md | ||
selftest.sh | ||
warmcat.com.cer |
lws minimal http client multi
build
$ cmake . && make
usage
The application goes to https://warmcat.com and receives the page data same as minimal http client.
However it does it for 8 client connections concurrently.
Commandline Options
Option | Meaning |
---|---|
-s | Stagger the connections by 100ms, the last by 1s |
-p | Use http/1.1 pipelining or h2 simultaneous streams |
--h1 | Force http/1 only |
-l | Connect to server on https://localhost:7681 instead of https://warmcat.com:443 |
-n | Read numbered files like /1.png, /2.png etc. Default is just read / |