microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.91k stars 1.64k forks source link

HTTP lister failing with IPv6 addresses #1705

Open mpanwar-github opened 2 years ago

mpanwar-github commented 2 years ago

I am trying to use IPv6 address with http listener but giving below error.

Starting listener at url.http://[fe80::a3fe:944b:534f:7ec%enp24s0f1]:8585 terminate called after throwing an instance of 'web::uri_exception' what(): Invalid hexadecimal digit

And used lookback address as wel.

While using address as "http://[::1]:8585"

terminate called after throwing an instance of 'boost::wrapexceptboost::system::system_error' what(): resolve: Service not found

Your response will be much appreciated.

barcharcraz commented 2 years ago

huh, in the first case it looks like we fall over on scopes, the second might be some other issue.

Can it bind to the default interface "[::]" or perhaps "[::]/128"?

barcharcraz commented 2 years ago

obviously that's not a workaround, but I have seen instances (esp on linux) where the loopback interface is not assigned the normal address because of configuration issues. I know you're on linux (or maybe mac/bsd) because windows scopes are numeric. Actually enp24s0f1 looks like a systemd "predictable name" so you're probably on linux.