Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Server does not work from public IP, but localhost or other SDKs are fine #1434
Comments
|
This is on Windows. |
|
I did another test with NetCat, listening on my local machine and sending a request from outside through the public IP to that same port 45050 and it all works fine. Is there anyway to get more verbose debug infos or anything useful out of it? |
|
I am running into similar issue.Host name set to 'LocalHost' works fine. setting host={machinename} starts listener but request doesn't happen and instead get error 'connect ECONNREFUSED'. |
This, and ONLY this is working. I cannot explain it myself, but that's how it is. |
|
Oh and it ofcourse only works on a freshly setup windows server 2019, on my windows 10 I get a nice exception from the HttpAddUrlToUrlGroup call:
why |
|
So regarding the error on my win10 system, I fixed it by checking |
|
Thank you fxfire that worked for me as well. |
|
After 3 days of wasting my time on something so basic, I finally found a solution in some dark area of the internet: Since the HTTP Server API internally uses a kernel module http.sys, the C++ REST SDK service program is not the same as the normal TCP service program through the Windows Firewall. It is invalid to directly use the executable file of the program to establish the firewall rules. The correct way is to create a new inbound rule, set the program name to system, and set the local port to the port number you want to listen to. This information is so important for Windows users, it should literally be NAILED ontop of the github wiki. |
|
@fxfire Hi there. I just encounter this problem but this code
not working for me, and i create inbound rule but i dont realy understand why you need to change name of the app ? |

When running the http_listener
This simple code works fine, when I use localhost as url. However, when I try to access the above from the public IP, nothing is received.
The connection goes through a router where the port 45050 is correctly forwarded to the machine (yes, I've tried also others and also made sure the port is not yet used). The forwarding is correctly setup, since it works fine when I use another restapisdk for the same purpose.
The ports are open and in theory it should work...but it does not.

And yes, I've started the program with explicite admin rights. This is all the info I can get from the connection:

Anyone has an idea what might be the cause or how to make that thing work?