Connection refused when tryign to run bottle/flask web framweworks

Νίκος nikos.at.superhost at gmail.com
Tue Aug 21 09:46:27 EDT 2018


Τη Τρίτη, 21 Αυγούστου 2018 - 4:39:50 μ.μ. UTC+3, ο χρήστης Michael Torrie έγραψε:
> On 08/20/2018 06:07 AM, Νίκος wrote:
> > Iam trying to access the bottle web framework running on my VPS as
> > 
> > http://superhost.gr:8080/hello
> > 
> > i get connection refused
> 
> > The weird thing is that in my vps command line my hello app is in state of listening
> > 
> > [root at superhost public_html]# python3 app.py 
> > Bottle v0.12.13 server starting up (using WSGIRefServer())...
> > Listening on http://localhost:8080/
> > Hit Ctrl-C to quit.
> > 
> > So, i wonder why the socket with port 8080 aint being displayed.
> 
> Why do you wonder?  You're using the wrong url.  The message that's
> displayed when you start your mini app says it's listening on localhost,
> which is 127.0.0.1.  Yet you are trying to access the url
> http://superhost.gr:8080/hello, which is a completely different IP
> address.
> 
> For security reasons while you're debugging and developing, most web
> frameworks bind to localhost, not your public address. So you need to
> access it via localhost:
> 
> http://localhost:8080/hello
> 
> If you notice, this is the exact url that your program told you it was
> listening on.
> 
> It is possible to configure flask to listen on "*.*.*.*" which means
> listen on all interfaces, localhost as well as the outside address.  But
> this is not recommended. Instead you would publish it to the outside
> world through another web server like Apache.

But my mini app runds on my remote VPS and iam trying to access it from my windows 10 machine.


Also '0.0.0.0' which listen to all network interfaces on the VPS still isn't allowing the mini app to be access from the outside world.

Should i try superhost.gr/ip address in order to access it?



More information about the Python-list mailing list