Stiffstream / restinio

Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library with the right balance between performance and ease of use
Other
1.15k stars 93 forks source link

Only requests from the localhost are handled #73

Closed guteksan closed 4 years ago

guteksan commented 4 years ago

I managed to start the minimalistic "hello world" server on port localhost:2001, and check it from the same machine. Both "curl http://localhost:2001" and running the address from the browser on this machine work. But when I try to do the same from another host (checked for 2 different machines) in the same network, i get:

$ curl http://cudap6:2001
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
curl: (7) Failed to connect to cudap6 port 2001: Connection refused

The connections are not blocked on the system level, because I can run another service on the same port, which is based on Restbed framework, and it works.

I am enclosing tcpdump from an failed attempt to run address "cudap6:2001" in browser at cudap4. tcpdump_failed.txt and the tcpdump from similar attempt which was successful when a Restbed service was running on the same port. tcpdump_success.txt

eao197 commented 4 years ago

Try to start REStinio server at "0.0.0.0:2001" or "cudap6:2001".

guteksan commented 4 years ago

Ok, 0.0.0.0 worked. Sorry, did not expect a different behavior for these two adresses, as in Restbed, which I used so far, the address is usually never specified.