lua.wetgenes.tasks_msgp.ipsniff
Use ( google by default ) public dns servers to check if we can connect to the internet and if we have ipv4 and/or ipv6 available.
To use alternative dns pass in an ipv4 and ipv6 address as the first two args, eg to use cloudflare.
ipsniff("1.1.1.1","2606:4700:4700::1111")
returns the ipv4,ipv6 address of this host when connecting to that dns or nil if no connection possible.
This result can be used as a bool to indicate working ipv6 or ipv4 internet and is also a best guess as to our ip when connecting to other devices.
Note that this will only work if we are connected to the internet can reach the dns servers etc etc, standard networks can be crazy disclaimer applies.
So great if this works but still need a fallback plan, eg assuming local ipv4 network is available.