I’m a developer and in my day to day, I need to access my application locally. The famous localhost:3000.
But when I used Manjaro, it was possible to access my localhost on another pc through the same network.
For example pc-ip/3000. Now I needed to use Windows with Arch WSL and I can no longer access my localhost on another pc. Is it possible to do that?
This is not at all related to Manjaro. In any case, it should be possible, you need to check the firewall settings.
For clarifying sake:
localhost is (usually set as) an alias for IP 127.0.0.1, which is the standard IP for pointing the local machine.
- Thus, accessing the “localhost on another pc” is actually accessing a server on another machine, either through its network name or (network bound) IP.
- Accessing a web server from another machine requires that the server machine allows inbound connections.
So, in order to access a distant web server, you need to
- check the network name / IP and port used is correct
- check the web server allows inbound connections (which may not be the default)
- check the server machine allows inbound connections, as @pobrn suggested
You have never done that.
localhost = 127.0.0.1 = non-routable address
Which ever environment you use, bind the service to 0.0.0.0:5000 - then you can access from another system - suffice no firewall is active.
I don’t understand, how would I do that?
Are you? Which framework is it?
And which server? There will be a config where you can set the IP.
That said, if you want to have your page accessible outside your machine, you need to deploy your page on a web server.
Alternatively, since it doesn’t actually need a server to run, you can make your page accessible from other systems through network sharing, like any other file:
You are no developer but a script kiddie.
You can forward port via ssh.
They are accessing on port 3000, so a server must be running on “localhost”.
This is the default port for reactjs applications.