简体   繁体   中英

connect localhost from another machine

Is there anyway i can navigate to a website i develop on my computer from a smartphone connected to the same network? the site is running on localhost, can I make a bridge or something like that?

thanks.

I think you can if you use you're IP directly as the website's name.For example in TOMCAT all the sites are localhost:port/Project_name/filename.html

So if you would use "http://your_ip:port/Project_name/filename.html" , it should work.

As a note, the firewall may stop this from working.

As long as your site is available to the network, just use the name of your PC.

So if you were developing on http://localhost:12345 connect using http://muzE-PC:12345 (assuming muzE-PC was the name of your computer)

instead of localhost use, ip address.

Make sure that website is not blocked by windows firewall .

ipconfig can be used to determine ip address.

On remote system, localhost will refer to that remote system (not the system on which web site is running).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM