C # HttpListener and Windows Firewall

One of the programs I'm working on has a built-in web server, designed only to handle very specific requests (static). Unlike TcpListener, when the HttpListener is running, the user is NOT prompted to allow which networks are allowed to listen to the program. This causes a big problem, because the program needs to listen to remote connections that are now prohibited by the Windows firewall.

If I create a new rule in the Windows firewall and select my program in the "Programs and Services" section, the windows will still deny all remote connections ... but if I select "All programs that meet the specified conditions", then it works fine. Why is my question? Why does the firewall reject my application when it is specifically selected? And why doesn't the user receive a request with a firewall security screen, as with other Listeners?

+3
source share
1 answer

This is because the HttpListener is built on top of http.sys, which will listen on the port you specify on behalf of your program.

, HttpListener Windows, :

  • " " " "
  • TCP " " ,
+9

All Articles