9

I'm working on two computers on the same network. Computer A has an app working on localhost:4444. However, I can't access it from the browser of Computer B.

Here is my situation:

  • I pinged it's IP and I'm getting successful responses.
  • I've tried accessing through the browser: http://192.168.X.X:4444
  • I'm currently sharing files across both computers via the same network successfully.

Can anyone please help me make this work?

12
  • For the service on Computer A, is it bound to only the localhost adapter or all network adapters? Can Computer A access the app from itself by connecting to the IP:port ? Firewall on computer A ?
    – ivanivan
    Mar 13, 2018 at 17:17
  • 2
    From an administrator elevated command prompt, try adding a rule to allow TCP port 4444 thru the Windows FW: netsh advfirewall firewall add rule name="TCP Port 4444" dir=in localport=4444 protocol=TCP action=allow. Test the connection afterwards from the other machine on the same subnet and confirm whether or not that fixes it. You can run netsh advfirewall firewall delete rule name="TCP Port 4444" from the same admin elevated command prompt to remove the rule if that does not work though. Mar 13, 2018 at 19:22
  • 1
    It sounds to me like the web server you are trying to connect to (perhaps a development server built into a web framework?) is only listening to localhost. It would be helpful to know more about the application you're trying to connect to. Mar 13, 2018 at 20:06
  • 1
    @gespinha Did running netsh advfirewall firewall add rule name="TCP Port 4444" dir=in localport=4444 protocol=TCP action=allow help resolve this matter for you on your Windows server hosting the site? I assume the site hosting machine is Windows as you have tagged in the question but if the hosting server for the site is Linux, try running firewall-cmd --permanent --zone=public --add-port=4444/tcp and see if that helps any. All the commands I provide should be run on the server hosting the site you are trying to connect to remotely. Mar 14, 2018 at 10:58
  • 1
    @PimpJuiceIT I was in very similar situation, trying to get a Cinema 4D render server accessible on the network. I changed your ports for the C4D browser port, ran script and it worked like a charm! Thank you!
    – AutoBaker
    May 23, 2019 at 10:50

2 Answers 2

12

I know this is an older question, but @PimpJuiceIT answer worked for me in a very similar situation, so full credit there.

  1. Open an elevated command prompt (press windows, type "cmd", right click on "Command prompt" and run as administrator)

  2. Type in the following code, but replace the "4444" with the port you need to access

  3. netsh advfirewall firewall add rule name="TCP Port 4444" dir=in localport=4444 protocol=TCP action=allow

  4. press enter, you should get a confirmation text.

  5. Test to ensure you can now access the app through network.

3
  • this looked sooo promising but it still does not work for me. administrator work sure is frustrating... god damn
    – Dbl
    Sep 11, 2019 at 11:41
  • @Dbl - company PC? could it be some extra restrictions by company policy?
    – AutoBaker
    Sep 16, 2019 at 6:57
  • 1
    It was an application error after all where the application did not bind to the port as configured. #3 did make it work :)
    – Dbl
    Sep 16, 2019 at 18:46
9

Open a Command Prompt window and execute the following command to confirm whether or not your web application is listening on all IP addresses:

netstat -a -o

You'll see output similar to the following:

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:135            JHUEBEL-VM:0           LISTENING       944
  TCP    192.168.0.173:5040     JHUEBEL-VM:0           LISTENING       5096

I've trimmed the output above down to a couple of examples.

Note how the first line has the IP address "0.0.0.0". This indicates that the service using port 135 (":135") is listening on all IP addresses. That would include localhost (127.0.0.1), as well as the LAN IP address (192.168.0.173).

But if you look at the second line, the service using port 5040 is only listening to the LAN IP address (192.168.0.173). So, I wouldn't be able to access that service via localhost.

So, what you're looking for is a line that starts something like this:

TCP    127.0.0.1:4444

If you see "127.0.0.1" (or really any IP address starting with "127."), then the web application you're trying to access is only listening to localhost and is not accessible by computers on your LAN.

So, how do you fix this? That really depends on the application. It will probably require editing a config file. Without knowing the application you're using I really can't help there. Please update the OP with more information about the application and I'll try to help further.

2
  • If the Windows netstat is the same as the Linux netstat you can do netstat -l46n to show all listening ports on IP or IPv6 interfaces.
    – ivanivan
    Mar 14, 2018 at 1:58
  • Thank you. "So, how do you fix this? That really depends on the application. It will probably require editing a config file." helped. In my case i needed to run my app that was meant to be available from the outside, so instead of running on "localhost" i run it on "0.0.0.0:4444"
    – cryss
    Feb 28, 2020 at 13:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .