Is there is any way to access my servlet project outside network to which my laptop is connected ? Any hint or heading will be helpful
-
This should provide more insights into your issue: https://stackoverflow.com/questions/10598926/access-localhost-from-another-computer-not-on-network This one as well https://superuser.com/questions/228975/allowing-access-to-localhost-outside-network – Shivam Aggarwal Jun 30 '17 at 06:30
-
The answer from Alex makes perfect sense. – Shivam Aggarwal Jun 30 '17 at 09:25
3 Answers
For that your need to host your project to any common server that is accessed by all the networks. Like you can use goDaddy.com to host your project

- 59
- 1
-
Thank u Can u explain. Why i can't access it just by entering global ip address of my lapton ? – Ankit Halder Jun 30 '17 at 05:53
-
Because project you run on your localhost is just accessible only on the same lan your are connected. And may be this is due to security purpose that no one on internet cannot direclty assess your system – Saurabh Kumar Jun 30 '17 at 11:48
First, you'll need a domain. You can upload your project there. Your domain can either be bought, or free.
Bought domains will allow you to upload a lot, while free domains will usually allow you to upload only a limited amount of content; not to mention that you sometimes have to host some ads if it's free.

- 15
- 1
- 1
- 6
If you'd like to serve your web application from your laptop you'll need to tune the configuration on your router and open up the port that your server is using (let's say 8080) and forward it to your local computer's IP address.
The ISP router might have multiple computers connected, and when it receives an incoming connection over TCP, it doesn't really know who to send and what to do with that connection. By default it'll drop it, but you can decide to forward it.
If you don't have access to your router, then you have some alternatives like using ngrok
to create a tunnel initiated from your computer to a cloud service that will forward over this tunnel the incoming requests over a random domain (fqdn) that they will generate.
When you're planning to move your application in production, consider hosting it in a proper hosting provider such as goDaddy, AWS, GCE,...

- 1,534
- 12
- 18
-
Thank u so much Can u explain what exactly i have to do with my router? – Ankit Halder Jun 30 '17 at 10:03
-
It depends on the brand and these instructions are not universal: login in your router (normally admin/admin, 1234/1234, admin/1234...) and go to forwarding or port forwarding. Normally there's a table that contains port range/type. Normally the router lets you forward a port to another. Let's say the external port 80 can be mapped to the internal 8080 on your laptop's IP address. Bear in mind that you should assign a static IP address on your laptop to avoid DHCP from assigning a random one next time you plug it in. – Alex Roig Jun 30 '17 at 10:06
-