应用程序终止时停止互联网活动

发布于 2024-11-09 09:57:20 字数 842 浏览 0 评论 0原文

我正在摆弄 FiddlerCore 和 .NET 并制作一个 Internet Filter 应用程序。如果应用程序未运行,我想“停止”或阻止互联网活动,类似于Covenant Eyes 终止或注销时的行为。

我想实现类似的行为。我尝试完全不关闭 FiddlerCore,这有效,但任何知道自己在做什么的人都可以轻松删除代理。 这样做:

Fiddler.FiddlerApplication.Startup(8877,fcsf);
        Fiddler.FiddlerApplication.BeforeRequest += new SessionStateHandler(FiddlerApplication_BeforeRequest);
        Console.ReadLine();

并且从不调用 Fiddler.FiddlerApplication.Shutdown(); 是有效的,如上所述(HTTP[s] 连接失败),但通过删除该代理可以轻松恢复连接。 我尝试将 FiddlerCore 设置为不是系统代理(使用:FiddlerCoreStartupFlags fcsf = FiddlerCoreStartupFlags.Default; fcsf = (fcsf & ~FiddlerCoreStartupFlags.RegisterAsSystemProxy); ) 但它似乎仍然设置了代理。

基本上,我想在应用程序停止运行时挂起连接,并在重新加载时恢复连接。有什么想法吗?让我知道我是否需要提供更多信息。谢谢!

I'm messing around with the FiddlerCore and .NET and making an Internet Filter application. I'd like to "stall" or prevent Internet Activity if the app isn't running, similar to how Covenant Eyes behaves when it is terminated or logged out.

I'd like to implement a similar behavior. I tried just not closing the FiddlerCore at all, which works but the proxy can easily be removed by anyone who knows what they're doing.
Doing this:

Fiddler.FiddlerApplication.Startup(8877,fcsf);
        Fiddler.FiddlerApplication.BeforeRequest += new SessionStateHandler(FiddlerApplication_BeforeRequest);
        Console.ReadLine();

and never calling Fiddler.FiddlerApplication.Shutdown(); works, as mentioned (HTTP[s] connections fail), but connectivity is easily restored by removing that proxy.
I tried setting FiddlerCore to not be the system proxy (using: FiddlerCoreStartupFlags fcsf = FiddlerCoreStartupFlags.Default;
fcsf = (fcsf & ~FiddlerCoreStartupFlags.RegisterAsSystemProxy);
) but it still seemed to setup a proxy.

Basically, I'd like to hang connectivity when the app stops running, and restore it when it loads back up. Any ideas? Lemme know if i need to provide any more information. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森林散布 2024-11-16 09:57:20

我很确定你不能这样做。 Fiddler 只是一个代理,Windows 允许用户更改其代理设置。

I'm pretty sure you can't do this. Fiddler is just a proxy, and Windows allows users to change their proxy settings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文