Connection refused when tryign to run bottle/flask web framweworks

dieter dieter at handshake.de
Tue Aug 21 00:58:28 EDT 2018


Νίκος <nikos.at.superhost at gmail.com> writes:
> ...
> 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.

I cannot tell you.

What you see above is an informational message created by the software.
While not very likely, it is in principle possible that it does
not reflect the truth - and your script is not really
"listening on http://localhost:8080". Debugging (see e.g.
the "pdb" (= "Python DeBugger") module in the Python library)
might help to understand what your script does in detail.

Another possibility might be that the "ss" command works differently
from what you expect. Maybe, it needs special parameters to display
ports in the listening state. Check its documentation.


If client and script run on different hosts, then a firewall inbetween
may have surprising effects. Especially, it can cause
"Connection refused" errors. For this reason, you may try first
to run your client on the same host as your script (and access
the script with "localhost"). If this, too, gives you
a "Connection refused", then debugging your script might be the next
step.




More information about the Python-list mailing list