How mobile browser link local computer service website

 

 

Reference blog: mobile phone connected to the computer server-based engineering SpringBoot

1, start the service

2, turn off the computer firewall  

Or allow the connection port 80;
settings:
open the control panel -Windows Firewall - Advanced Settings - inbound rules - New Rules - Port - Input 80

3, to ensure the link of cell phones and computers

(1) under the same wifi: to ensure mobile phones and computers on the same local area network under

(2) the computer in wifi or wired case, turn on the computer hot, hot mobile phone connected to the computer, then the mobile browser to access the computer's ip: port services open access.

 

Challenges: returns the error "reject the connection -102"

  Phenomenon on your computer browser: localhost: 8090 and 127.0.0.1:8090 can open normally. But this machine ip: 8090 can not be opened.

I suspect: the port is not open or firewall problem. But after setting out the rules and turn off the firewall port, still as ever. 

The essential problem: still unclear.

Solution:

 The node.js server can use localhost access, but why not visit IP

Because my service is started by Node.js way to start, and Baidu a nodejs localhost ip access inaccessible find this article.

 I found that as long as the hostname set to null.

Because I use Cesium start direct services server.js, so look directly at him in js:

Will be one of "localhost" to "" empty string, restart services on it.

 

 

 

 

 

 

Published 38 original articles · won praise 19 · Views 100,000 +

Guess you like

Origin blog.csdn.net/weitaming1/article/details/104608218