cpprestsdk icon indicating copy to clipboard operation
cpprestsdk copied to clipboard

HTTP listener crashes on Windows when listening on 0.0.0.0

Open marcofiocco opened this issue 8 years ago • 4 comments

If I ignore the exception it runs, but it's not able to receive any message, and when I stop it it throws another exception...

marcofiocco avatar Mar 07 '17 22:03 marcofiocco

Looks like if I listen to http://*:8000 it works, instead of http:/0.0.0.0:8000

marcofiocco avatar Mar 08 '17 11:03 marcofiocco

try it in CMD: netsh http add urlacl url=http://*:8080/ user=BUILTIN\Users listen=yes

catknight avatar Mar 22 '17 12:03 catknight

I have the same problem. For me these two points work: 1- you have to set http_listener url as : "http://*:port". 2- run your code as admin

mahdisn76 avatar Aug 04 '19 08:08 mahdisn76

"http://*" => this is loopback of ipv6 not default route. "0.0.0.0" is not ADDR_ANY but LOOPBACK. it's different.

If you want is "http:/0.0.0.0:8000", listen to "http://0:8000" instead of "http://*:8000"

chaseYLC avatar Nov 19 '21 11:11 chaseYLC