cpprestsdk icon indicating copy to clipboard operation
cpprestsdk copied to clipboard

Support IPv6

Open CreateRan opened this issue 11 months ago • 0 comments

I write a test code to listen ipv6 address with uri "http://[::]:34962" on linux, but exception is thrown: resolve: Service not found [asio.addrinfo:-8] It seems there is issue in the constructor of class hostport_listener, the hostname and port number are resolved simply by using colons as separators. This approach works for IPv4 URLs in the form x.x.x.x:port (e.g., 0.0.0.0:34962). However, for IPv6 addresses, which inherently contain colons, this method fails. Could you please help confirm? Thank you.

Image

CreateRan avatar Feb 24 '25 10:02 CreateRan