应用程序终止时停止互联网活动
我正在摆弄 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;
) but it still seemed to setup a proxy.
fcsf = (fcsf & ~FiddlerCoreStartupFlags.RegisterAsSystemProxy);
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我很确定你不能这样做。 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.