2

I'm trying to get the "Hello World" example for Web.py working and it's giving me an error:

enter image description here


enter image description here


This person seemed to be having the same issue in 2011 and the sole response suggested it might be a firewall issue. I have tried setting a new port as described here and it made no difference. I know that the new port I tried (5000) is not blocked by any firewall on my computer, so this isn't a firewall issue.

Nathan Wailes
  • 9,872
  • 7
  • 57
  • 95
  • @brunodesthuilliers Thanks for telling me, I was wondering why it was getting downvoted. Honestly, though, I don't see why either of those apply to this situation since the "Hello World" example for Web.py is easily Googleable. It's not like this is custom code. And there's no lengthy stack trace here for people to transcribe. – Nathan Wailes Feb 22 '18 at 11:46

2 Answers2

11

0.0.0.0 is the IP address is bound to. Your server will be reachable on every interface of your machine on any of the IP addresses that your computer has been assigned.

To contact the server, you need to specify its actual IP address. 0.0.0.0 is not a valid IP address. For instance, if the server runs on your local machine, try http://127.0.0.1:8080/ .

phihag
  • 278,196
  • 72
  • 453
  • 469
  • Thanks for the answer, that fixed it. But what do you mean by "the server will be reachable on *any* IP address"? I just tried "1.1.1.1:5000" and it didn't work. I still don't understand why it would say "0.0.0.0:5000" if it wasn't actually using that IP address. – Nathan Wailes Feb 22 '18 at 11:35
  • The IP address the server is bound to restricts **incoming** connections to the server. For instance, another computer on your LAN can connect to your server, by using your computer's local IP address (something like `192.168.1.x:8080`). When you type an IP address or domain name in your web browser, that is the *outgoing* address. Since 1.1.1.1 is not an address of your computer (it belongs to a computing research lab in Asia which hands out addresses), the packets will not reach your computer in the first place. – phihag Feb 22 '18 at 11:42
3

You can't visit 0.0.0.0, that just means your server is listening on all addresses. You need to visit localhost, ie 127.0.0.1.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895