I am running a webserver on my local network, I am able to connect it via other devices ( like a smartphone ) to that local server, but when I am want to expose it via router forwarding it does not work?
Router config:
Server / app example:
Private IP address:
Related
Is it possible to change the URL used to access my local NodeJS server?
For instance, I have a Node server running on port 3000, so I can access this server directly through:
http://localhost:3000/
And other users on my network can access it through:
http://[MY_IP_ADDRESS]:3000/
Is it possible to forward this server to a local URL, like http://example/
I know that, in order to remove the port from the URL I need to bind the app on port 80, but I can't find anything about changing de URL.
Not very clear what you want, to be honest and your set-up. You use local computer or server in local network?
If you want URL in your local network isolated - that's not possible hence the URL protocol forwards requests from domain name to certain ip address.
If you want only internal access in your local network you only need to know your local ip address and make sure your firewall allows local connections. Depending on your OS run ip check in cli and voila - that's your ip.
If you want external connections then you need to have a static ip address which you should obtain from your internet provider and afterwards you need to alter you router settings and set up port-forwarding to your local machine. It will then listen to external connections on certain port and forward it to your local machine where nodejs listens (itself or through web-server). Here you can redirect your domain URL name via A-record to your static ip address of your router and port-forward to local machine.
Check out this guide for most routers for external port-forwarding.
UPD: checkout this answer
I am using express.js to run a http server. Is there a way to prevent other devices on my network to able to access the port 3000 via my IP address?
I tried to connect to an IIS from WiFi but I couldn't although I succeeded connecting to it while that device was connecting to the router via LAN.
How should I change the router settings to connect to other devices localhost when all the devices are connected to the router via WiFi?
Router model: TP-link TD-W8901N
As far as I know, without using the DNS server, you couldn't access the web sites by using localhost url.
The only way you could access the site is using the ip address and the right port number.
You could firstly run ipconfig in the cmd tool on the IIS server.
Then you will record the IP address and the site's port number.
At last, you could use the IP address and the site prot number to access the sites.
Thr url like this: http://192.168.1.3:8098
How would I get the LAN IP of a user connected to my node.js app ?
I can get the WAN IP, but not sure how to get the LAN IP. I tried this
How can I get the local IP address in Node.js?
but all it does is give the LAN IP of the machine the node app is running on.
Facts:
I have the public ip address of my router that is static that i got from my ISP(internet service provider).
I also have a web server with windows server 2008 r2 edition.
I have my domain pointed at the public ip address of the router.
Question:
how do i set the web server up, with the router, to manage requests to the website.
Example:
i need to know how to do this:
When someone enters my domain name into their web browser , the DNS server sends them to the ip address of my router, then my router sends them to my web server to display my web site.
Go to your routers settings (most routers its 192.181.1.1 but look under your router for yours)
Type in your username and password (also located under the router) and once in find the port fowarding settings.
Have it foward all port 80 traffic to the ip address of your computer. So if your computers ip is 192.168.1.3 make it direct traffic to that ip.
Your router does port based natting for traffic from your inside 192.x.x.x network and the outside internet using your public IP.
What you want to do is called reverse NAT. For that you have to define a mapping of your internal IP and port number to an external IP and port number. It looks something like this
X.X.X.X:80 ------------> 192.168.1.x:80
X.X.X.X is your public IP and 192.168.1.x is the ip of machine where you are running webserver. Once you have this mapping it will let outside traffic to come inside using reverse NAT.
Most of the router have this feature listed as port forwarding where you have to create this type of mapping. They will ask you external port and internal ip and port to map to.
-MS