What else could be blocking my access to the webserver on the other laptop in the local network?

2

I setup the webserver on a desktop (with win 10) which runs fine locally with localhost:4200. Now, I want to access it from another laptop like 192.168.0.110:4200, but I get an error "192.168.0.110 refused to connect" and it asks me to check the connection and proxy and firewall. I know I do have connection and I purposely turned off the firewall on the other machine. What strange to me is that from my laptop I can access the MongoDB (using port 27017) installed on the same desktop without problem. So, what else could it be blocking my access the website using 192.168.0.110:4200?

EDIT: On Frank's tip,

netstat -abno | findstr LISTENING | findstr 4200
TCP  127.0.0.1:4200   0.0.0.0:0  LISTENING  9220

I can't upload a screenshot, but the error is a typical one you get in Chrome with code "ERR_CONNECTION_REFUSED".

C:\WINDOWS\system32>telnet 192.168.0.110 4200
Connecting To 192.168.0.110...Could not open connection to the host, on port 4200: Connect failed

Actually, about a year ago, I managed to set up the server on the same machine without problem, and it ran for a few months. My server is node/express on windows 10. I even got it to work with port forwarding to my ddns.net service.

miliu

Posted 2017-11-11T06:08:39.197

Reputation: 123

if you run powershell as admin on the server box, and enter netstat -abno | findstr LISTENING | findstr 4200 , what does it say? please add it to your post. also, please post a picture of your error. what is the exact url you are using to access the site? if from the client you run telnet 192.168.0.110 4200 what does it say? you may need to install telnet from the Turn On/Off Windows Features applet. – Frank Thomas – 2017-11-11T06:28:15.103

your webserver is listening on 127.0.0.1. you need to reconfigure it to run on 192.168.0.110 or on 0.0.0.0. The details on how to do that are specific to the webserver you are running, so look for instructions on how to configure listener IPs. while the server is listening on the loopback address, it will only respond to connections from the local machine. to test your fix, run both the commands again. – Frank Thomas – 2017-11-11T23:34:20.753

@Frank, Thank you very much for your hint which had helped me figured it out finally: ng serve --host 0.0.0.0 --disableHostCheck true. – miliu – 2017-11-12T14:54:59.817

Answers

3

You have not advised what webserver you are using or OS, but there are 2 likely contenders -

  1. The webserver may not be bound to the appropriate interface - you may be able to check this with netstat.

  2. There may be a firewall in the server - this is fairly common, but the ability to connect to MongoDB makes it less likely.

davidgo

Posted 2017-11-11T06:08:39.197

Reputation: 49 152

Thank you very much for the response. The netstat did help. The solution to my case is ng serve --port 8080 --host 0.0.0.0 --disableHostCheck true. – miliu – 2017-11-12T14:56:49.820