-2

I created a instance on GCE and started a python Flask hello-world script running on port 5000. Port 5000 is whitelisted in firewall settings.

Pinging the external IP was successful, but when I tried to access, I got this error:

"Failed to connect to 104.154.87.175 port 5000: Connection refused"

davidism
  • 121,510
  • 29
  • 395
  • 339
Xi 张熹
  • 10,492
  • 18
  • 58
  • 86

1 Answers1

2

Try this app.run(host=0.0.0.0)

For example 192.168.1.1 is your machine ip. 192.168.1.0 is the entire subnet your machine is in. And 0.0.0.0 is for all existing IPv4 networks around the world.

CESCO
  • 7,305
  • 8
  • 51
  • 83
  • Can you explain why it will work ? – Zulu Oct 27 '15 at 12:33
  • This serves the app through all the network. For example 192.168.1.1 is your machine ip. 192.168.1.0 is the entire subnet your machine is in. 0.0.0.0 is the entire network. – CESCO Oct 27 '15 at 12:53