kaszanka
Posts: 2
Joined: Wed Jun 22, 2016 7:24 pm

Connect to HTTP server from internet

Wed Jun 22, 2016 8:24 pm

Hi,

I ran a tutorial including HTTP server app for raspberry pi 3.
Link here: https://incredibits.io/project/windows- ... web-server

In my local network everything works perfectly. I run server, type in browser local IP of my raspberry (192.168.x.x) and "hello world" appears - great. But, I have an issue when i want reach my HTTP server outside from my LAN.
What i did:
  • 1. forwarded port 80 in my router
  • 2. opened port 80 in raspberry pi with below commands in PowerShell

Code: Select all

netsh advfirewall firewall add rule name="Open 80" dir=in action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name="Open 80" dir=out action=allow protocol=TCP localport=80
  • 3. checked if above commands works by typing

Code: Select all

netsh advfirewall firewall show rule name="Open 80"
and i get that response:

Code: Select all

Rule Name:                            Open 80
----------------------------------------------------------------------
Enabled:                              Yes
Direction:                            Out
Profiles:                             Domain,Private,Public
Grouping:
LocalIP:                              Any
RemoteIP:                             Any
Protocol:                             TCP
LocalPort:                            80
RemotePort:                           Any
Edge traversal:                       No
Action:                               Allow

Rule Name:                            Open 80
----------------------------------------------------------------------
Enabled:                              Yes
Direction:                            In
Profiles:                             Domain,Private,Public
Grouping:
LocalIP:                              Any
RemoteIP:                             Any
Protocol:                             TCP
LocalPort:                            80
RemotePort:                           Any
Edge traversal:                       No
Action:                               Allow
Ok.


I know, that someone can think that there is an issue with my router or internet provider. But i think that isn't a problem. I ran exactly the same app in my notebook (with windows 10 ofcourse). I forwarded port 80 in router into my netbook, i checked if port is open - and it was OPEN. I type my external IP into browser and it works. I even try to do it from my smartphone to be sure and it also works.

I think that is a proof that a problem is in my raspberry. I dig deep in web but i cant find a solution.

i will be gratefull for any advice.

tsaG
Posts: 80
Joined: Thu Jun 26, 2014 1:30 pm

Re: Connect to HTTP server from internet

Tue Jun 28, 2016 6:55 pm

If you can reach it from within the network, there is an error in your router setting I think.

Did you really forward Port 80 from outside to Port 80 of the raspberry pi? Maybe try to forward the external port 1234 to the raspberry port 80. Then you just have to try "yourexternalIP:1234" to reach it from the internet.

kaszanka
Posts: 2
Joined: Wed Jun 22, 2016 7:24 pm

Re: Connect to HTTP server from internet

Wed Jun 29, 2016 3:32 pm

I solved this. The problem was in my router settings. I have two NAT options (Virtual Server Setup and Port Triggering Setup) and i had settings like below:
Image

Removing "web" setting in NAT - Port Triggering Setup solved my problem. My HTTP server running on raspberry pi became visible for outside world.

I don't know why this settings didnt block HTTP server running on laptop - this confused me. But this is different story. The most important is that problem with raspberry pi http sever is solved.

Return to “Windows 10 for IoT”