[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [LuaSocket] IPv6
- From: Diego Nehab <diego@...>
- Date: Thu, 11 Jun 2009 03:55:06 -0400 (EDT)
Hi Nicholas,
One of the regressions against ejabberd that I noticed was that prosody
doesn't have IPv6 support - because LuaSocket doesn't have it either.
Given that it's 2009, I find that rather shocking so I've set out to
patch LuaSocket to include IPv6 support.
In the past 10 years, maybe the topic showed up 3-4 times. I
try to make the library as useful as possible without having
it explode in complexity. Now that there is interest, I am
more than happy to comply.
As far as API is concerned, I would try to make it as
IP-version agnostic as possible. So I would remove automatic
DNS from module tcp.c, and make it so that tcp:connect()
accepts only IPs in strings. These would either be IPv4 or
IPv6. All IP code should already be isolated in inet.c
anyways, so it shouldn't be hard. I would change dns.toip()
from gethostbyname/gethostbyaddr to getnameinfo/getaddrinfo.
Then, I would change socket.lua so that socket.connect()
still does automatic DNS lookups using the new dns.toip()
and passing the result to tcp:connect().
Does that sound like a reasonable plan?
Regards,
Diego