leafo / pgmoon

A pure Lua Postgres driver for use in OpenResty & more
MIT License
390 stars 93 forks source link

support ipv6 by using luasocket #116

Open jzdwk opened 2 years ago

jzdwk commented 2 years ago

@leafo luasocket is compatible with ipv6 by using socket.tcp6(), but pgmoon only uses socket.tcp(). so could it be a future task to improve upper-layer system(such as kong) by adding support for ipv6? more discussions please see

leafo commented 2 years ago

Happy to accept a patch. I don't think luasocket has an option to correct the correct tcp socket type for a hostname, so an option to force ipv6 would most likely be necessary.

Alternatively, you can try using the cqueues socket type. It's a more up to date library and may already work as expected.