1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/minimal-examples/raw
Andy Green c591e1adfc asynchronous dns for ipv4 and ipv6
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
2019-09-19 06:54:53 +01:00
..
minimal-raw-adopt-tcp clean: internally use LWS_WITH_CLIENT and _SERVER 2019-08-26 09:58:57 +01:00
minimal-raw-adopt-udp asynchronous dns for ipv4 and ipv6 2019-09-19 06:54:53 +01:00
minimal-raw-fallback-http-server clean: internally use LWS_WITH_CLIENT and _SERVER 2019-08-26 09:58:57 +01:00
minimal-raw-file clean: internally use LWS_WITH_CLIENT and _SERVER 2019-08-26 09:58:57 +01:00
minimal-raw-netcat clean: internally use LWS_WITH_CLIENT and _SERVER 2019-08-26 09:58:57 +01:00
minimal-raw-proxy sul: all timed objects use a single pt sul list 2019-08-09 10:12:09 +01:00
minimal-raw-proxy-fallback sul: all timed objects use a single pt sul list 2019-08-09 10:12:09 +01:00
minimal-raw-vhost clean: internally use LWS_WITH_CLIENT and _SERVER 2019-08-26 09:58:57 +01:00
README.md role: raw-proxy 2018-12-01 11:05:59 +08:00

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