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 |
||
---|---|---|
.. | ||
minimal-raw-adopt-tcp | ||
minimal-raw-adopt-udp | ||
minimal-raw-fallback-http-server | ||
minimal-raw-file | ||
minimal-raw-netcat | ||
minimal-raw-proxy | ||
minimal-raw-proxy-fallback | ||
minimal-raw-vhost | ||
README.md |
name | demonstrates |
---|---|
minimal-raw-adopt-tcp | Shows how to have lws adopt an existing tcp socket something else had connected |
minimal-raw-adopt-udp | Shows how to create a udp socket and read and write on it |
minimal-raw-fallback-http | Shows how to run a normal http(s) server that falls back to a specified role + protocol |
minimal-raw-file | Shows how to adopt a file descriptor (device node, fifo, file, etc) into the lws event loop and handle events |
minimal-raw-netcat | Writes stdin to a remote server and prints results on stdout |
minimal-raw-proxy-fallback | Shows how to run a normal http(s) server that falls back to a proxied connection to a specified IP and port |
minimal-raw-proxy | Shows how to set up a vhost so it listens for connections and proxies them to a specified IP and port |
minimal-raw-vhost | Shows how to set up a vhost that listens and accepts RAW socket connections |