[Libwebsockets] Lws 4.2 - Client with IPv4 and IPv6 connectivity- picks IPv6

Andy Green andy at warmcat.com
Thu Jul 29 21:14:15 CEST 2021



On 7/29/21 7:59 PM, smkmsk11 wrote:
> Hi,
> I am testing lws 4.2 stable version on host with IPv4 and IPv6 
> connectivity to server. Lws client (IPv6 ON) always picks IPv6 address.

It implements RFC6724 DNS results sorting.

https://datatracker.ietf.org/doc/html/rfc6724

> 1. Is there a way to make lws pick IPv4 first and then IPv6?
> 2. Does lws try all the connections (IPv4/IPv6) if one of them fails to 
> connect?

It goes through the sorted DNS results according to the RFC.

Implementing that was a very thankless task, there are many more 
possible ways to make it smarter, especially with Async DNS.

It'd be great if I got emails from people who want to benefit from this 
work, who also wanted to cooperate to improve it.

-Andy


More information about the Libwebsockets mailing list