Re: How to lookup the IPV6 addr of a domain name?

2018-12-03 Thread moerm
The getAddrInfo call doesn't return the full struct (only to 0xfff1). Moreover the first couple of bytes are _not_ part of the IPv6 address and the first address byte is the 5th byte after 0x50 (0x20, 0x1, ...). Frankly, I don't think it worth putting more work into the current solution. If

Re: How to lookup the IPV6 addr of a domain name?

2018-12-03 Thread Libman
I am confused by lots of things, including that the same constants like AF_INET6 are present with different values in `lib/nativesockets.nim` vs `lib/posix/posix_linux_amd64_consts.nim`. The edited above code now uses posix's AF_INET6 value (10.cint) cast to nativesockets Domain enum for

Re: How to lookup the IPV6 addr of a domain name?

2018-12-02 Thread moerm
@satoru Note that `getHostByName` is deprecated at least on linux. @Libman Nim (nativesockets) _does_ provide `getAddrInfo` but as you probably saw in your research it's all but worthless because it's a mess. Which btw. is hardly Nim's fault but rather a consequence of IPv6 being a makeshift

Re: How to lookup the IPV6 addr of a domain name?

2018-12-01 Thread Libman
I'm a n00b, and I've spent some time trying to research this without finding a good answer. I'm posting my notes in case they are helpful for someone... In C one would use [getaddrinfo](https://archive.fo/eFztO#selection-589.810-589.883). This is much easier in Python, which has a high-level