Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I access bottle development server from another PC on the LAN?

I'm running 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 is 192.168.1.10) from another PC on the LAN, using

http://192.168.1.10:8080/hello/world

I received the "Cannot Open Page" error.

I have the Apache web server running on the PC, and I can access the web server without any problem using

http://192.168.1.10

Any suggestions? Thanks.

like image 478
Ted W. Avatar asked Feb 19 '13 13:02

Ted W.


1 Answers

Assuming you're talking about the Quickstart: “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 to 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 should be able to access http://192.168.1.10:8080/hello/world from your local PC as well as another PC on the LAN. Alternatively use a Fully Qualified Domain Name (FQDN).

If connections are still refused, check your firewall settings.

like image 112
Johnsyweb Avatar answered Oct 19 '22 03:10

Johnsyweb