How to access the bottle development server from another PC on the local network?

I run the bottle.py tutorial on one PC and I was able to access it using

http://localhost:8080/hello/world 

However, when I tried to access it (IP address 192.168.1.10) from another PC on the local network, using

 http://192.168.1.10:8080/hello/world 

I got the message "Can not Open Page".

I have an Apache web server running on a PC and I can access the web server with no problems using

 http://192.168.1.10 

Any suggestions? Thanks.

+7
source share
1 answer

Assuming you are talking about Quick Launch Example: Hello World Example :

Change this line:

 run(host='localhost', port=8080, debug=True) 

To bind to the public IPv4 address of your computer:

 run(host='192.168.1.10', port=8080, debug=True) 

Or for this, to listen on all interfaces, including the external one [ Source : bottle.run , Bottle API Reference ]:

 run(host='0.0.0.0', port=8080, debug=True) 

Then you must have access to http://192.168.1.10:8080/hello/world from the local PC, as well as from another PC on the local network. Alternatively, you can use the fully qualified domain name (FQDN).

If connections are still rejected, check your firewall settings.

+24
source

All Articles