如何在Windows中检测防火墙? [英] How to detect a firewall in Windows?

查看:133
本文介绍了如何在Windows中检测防火墙?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用需要向网站发出GET请求,我希望能够知道它是否被防火墙阻止,并要求用户添加例外。

My app needs to make a GET request to a website and I'd like to be able to know if it's being blocked by a firewall, and ask the user to add an exception.

如何通过防火墙而不是其他方式找出我的获取请求失败?

How can I find out that my get request failed because of a firewall, instead of something else?

推荐答案

如果它是一个好的防火墙,你不能。在其他选项中,防火墙可以:

If it's a good firewall, you can't. Among other options, a firewall can:


  • 回复几种不同的 ICMP 消息,指示无法访问目标,或

  • 以静默方式丢弃请求,从而导致超时。

  • reply with one of several different ICMP messages, indicating the destination is not accessible, or
  • silently discard the request, resulting in a timeout.

一个合理的选择是解释为什么应用程序无法访问该网站,并提供一些有用的建议:

A reasonable option is to explain why the app was unable to access the website, and provide some helpful suggestions:


    No response from www.site.com:
    * Your computer may not be connected to the Internet.
    * The site may be down.
    * The site may be blocked by a firewall.




    The network indicated that www.site.com is not accessible:
    * Helpful messages go here.

重要的一点是,在失败的类型之间区分,或许比我更好,他们背后的原因。例如,故障排除无响应的步骤将与故障排除设备告诉我它没有在该端口上侦听的步骤不同。

The important point is to differentiate, perhaps better than I did above, between the types of failure, and the reasons behind them. For example, the steps for troubleshooting "no response" will be different from those for troubleshooting "the device told me it's not listening on that port."

这篇关于如何在Windows中检测防火墙?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆