dlundquist / sniproxy

Proxies incoming HTTP and TLS connections based on the hostname contained in the initial request of the TCP session.
BSD 2-Clause "Simplified" License
2.57k stars 398 forks source link

Optionally use the local resolver lib via NSS / getaddrinfo #336

Open HeikoSchlittermann opened 5 years ago

HeikoSchlittermann commented 5 years ago

The current sniproxy implementation uses UDNS for name resolution.

Our current setup uses containers as backends, with potentially dynamic name-to-IP mappings. The names are resolvable via nss-mymachines.

Using UDNS, sniproxy does not use the NSS mechanisms (does it?), not using UDNS sniproxy does not do any name resolution. Is there any reason, not to use getaddressinfo(), at least as an alternative (ideally configurable at runtime) to UDNS?

Would you accept a pull-request, if I implement getaddrinfo() as an optional resolving method (instead of the dummy functions) in the absence of UDNS? Or do I miss an important point?

flokli commented 4 years ago

@HeikoSchlittermann I'm also interested in this :-)

Do you have a patch somewhere which I could give a try?

flokli commented 4 years ago

poke ;-)