user8953567
user8953567

Reputation:

How to connect a small web server program to a web browser which is running in another device in the internet?

I had made a small web server program that can handle HTTP requests, it worked fine on loopback ip address. I Had connected the host computer to a wifi using a router, i can access that program using another device connected to the same router using a web browser. but the problem is when i tried to open the open the command from the device connected to another router/internet, it didnt connect. I had used the address like "10.0.0.4:8080" to connect with the device on the same router. later i tried with the public IP address to connect to my web server program but it didnt work! what am i missing in giving the correct ip address and port number such that it could be connected with the devices that arent connected with my router.

Upvotes: 0

Views: 456

Answers (1)

Gergo
Gergo

Reputation: 125

You have to add port forwarding on the router from outside to the specific IP of the device. Then use public IP from outside and public or private from LAN. Probably also set it to static internal IP from device or router.

DMZ to the device is also an option but is overkill.

That way lot of bots will scan your server so carefull with the security and what you expose.

Upvotes: 1

Related Questions