3

I have a mini http server running at port 9999, when I test on canyouseeme.org it succeeds and I can see a client connected to my server for a second.
Yet if I try to enter my external IP followed by the port 9999 I get connection refused message in Chrome and other browsers.
I tried reinstalling windows, disabling the firewall, adding exception to the firewall with no luck.

Edit: I also tried turning off Windows Defender, the only av I have.

Edit2: I try to enter my external IP on the same computer running the http server. My router is D-Link DSL-2790U

4
  • Can you please list your network setup? Include a diagram if possible and makes / models
    – Eric F
    Jun 27, 2017 at 19:09
  • You tried to enter your external ip from where? If you are not outside your local network (house...), you should use the internal IP, not the external IP. Most SOHO-grade routers do not support hairpin nat. Jun 27, 2017 at 19:10
  • @EricF, i am sorry but it's just a home hosted mini http server, i just run it and forward port in the router which is D-Link DSL-2790U by going to NAT settings and virtual servers.
    – user742915
    Jun 27, 2017 at 19:10
  • @user4556274 i am trying from the same computer running the server. (same network).
    – user742915
    Jun 27, 2017 at 19:12

2 Answers 2

3

To test a service (at a publicly accessible IPv4 address) running inside your home behind a home-grade NAT'ing router, you need to be outside your home. Most such routers do not support hairpinning, that is, NAT'ing a request made to the external IP address when it arrives on an interface other than that on which the external IP is configured.

0
1

Thanks to @user4556274. Based on his theory, Now I got a solution: I use a proxy server to test my local service.

My own router was not NAT'ing and I could test it directly using my public IP or DDNS.

Things changed after I used the router of my ISP, and I didn't know it was providing NAT, so my local tests always failed with 'connection refused'. But all "port forwarding test" sites tested out OK - the port is open.

After using a proxy server w/ one of Chrome's proxy extensions, I am able to connect & test my server, for it is the proxy server (as an external IP) that directly connects to my server. To do this, I need to configure my proxy to avoid bypassing local IPs.

6
  • @crazii, please specify which proxy server extension you used, for Chrome has many. Please click on edit and replace my link with the link to your specific extension, and specify its name in the last paragraph.
    – K7AAY
    Nov 9, 2018 at 22:50
  • @fixer1234 this is not a "thank you" answer, although it contains thanks. I bet there's obvious difference. I post my solution and hope it may help others.
    – crazii
    Nov 9, 2018 at 23:19
  • @K7AAY hey I feel Offended. Because I don't like my answer being edited without an advance notice. Is this really necessary? BTW the key is use proxy server and one chrome proxy extension. whichever working is Okay, should I really need to do this as a homework?
    – crazii
    Nov 9, 2018 at 23:26
  • superuser.com/help/editing
    – K7AAY
    Nov 9, 2018 at 23:32
  • 1
    @fixer1234 No, I consider it not being a new answer, but an supplement to user4556274' s answer. He states the principle & theory, I got a workaround/solution based on his theory. My solution is clear: to use a proxy server. if you have any confusion, please read it again carefully. You don't know if others have confusion as you do. We all don't. That's what voting is used for.
    – crazii
    Nov 9, 2018 at 23:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .