0

I have created ASP.NET API endpoints on my Windows 10 PC, hosted on IIS. Using Chrome's extension app, Postman, I could call the API internally within the same machine (using localhost and even my own local IP). Example:

http://localhost/UserService/api/user/getByUsername?username=abc

and

http://192.168.0.160/UserService/api/user/getByUsername?username=abc

Then I tried using another PC (Windows 7) to connect to the same Wifi LAN that my Windows 10 PC is connected to, and attempted to call the above example URL via Postman, but it did not get through (getting "Could not get any response"error). The Windows 7 PC could not call API hosted on Windows 10 PC.

However, when I reversed the setting ie to host on Windows 7's IIS (version 7.5) and used Windows 10 PC to call instead, no issue found.

What went wrong?? Is it due to some Firewall settings?

enter image description here

4
  • likely your port 80 is not open on the Windows 10 machine...hence you can call it locally, but not remotely. Commented Aug 14, 2017 at 10:53
  • I can open the site hosted locally on my Windows 10 machine. However, I could not do so using another machine. I also explicitly enabled port 80 on Windows 10 Firewall. It didn't help either. Commented Aug 14, 2017 at 10:55
  • what happens when you TEMPORARILY turn off the firewall, and try out your postman test? Commented Aug 14, 2017 at 11:05
  • I disabled the firewall temporarily as suggested. Seems like it is now working. But the problem is, my McAfee anti virus only allows me to disable it for short period of time temporarily. So that means I need to disable it EVERYTIME when I am playing around with the API. Commented Aug 14, 2017 at 11:51

2 Answers 2

1

A few things to check in Windows Firewall with Advanced Security:

  • Have you enabled the World Wide Web Services (HTTP Traffic-In) rule in Windows firewall exceptions?
  • Do you have any entries in the Remote Computers tab?
  • Is the action Allow the connection?
  • What is the content of your Advanced tab like?

EDIT

Based on your comments, the issue is indeed a firewall issue, but not Windows Firewall with Advanced Security. McAfee firewall is blocking external access to port 80. Add an exception to McAfee to allow port 80, and possibly 443. Consult McAfee's knowledge base.

Sign up to request clarification or add additional context in comments.

4 Comments

I've verified, it seems like World Wide Web Services (HTTP Traffic-In) is enabled by default (allows incoming traffic). I found out that if I disable my firewall (from my antivirus setting), I manage to get things through (API calls from another PC connected to same LAN). But I am not sure which is the specific setting that I need to set in order to get things through WITHOUT turning entire firewall off.
Ok... are you using an additional firewall? I mean, different from the built in one. The truth is, you shouldn't need to have both World Wide Web Services (HTTP Traffic-In) and ports added as exceptions.
I've got it! Your Windows Firewall with Advanced Security is having no effect because your firewall is controlled by McAfee. You need to add the exceptions there, but I am not familiar with their UI, so I can't help there
No worries, thanks @reckface. It has been a great help, at least we managed to identify what is the source of the problem.
0

With great help from @reckface, the root cause is found, which is in fact the McAfee antivirus itself. After exploring around the UI, I found the setting to allow incoming traffic for certain port(s) without needing to turn off firewall setting entirely.

enter image description here

With "Web Server (HTTP) Port 80" enabled on the UI, I can now access API's from another PC.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.