简体   繁体   English

如何拦截WebBrowser的每个请求并转发给webproxy?

[英]How to intercept each request of WebBrowser and forward to a webproxy?

I'm working on a WinForm WebBrowser and I want to forward each request to my web proxy and receive the response from the web proxy, the web proxy will forward the response directly to user, include headers and content. 我正在使用WinForm WebBrowser,我想将每个请求转发到我的Web代理并接收来自Web代理的响应,该Web代理会将响应直接转发给用户,包括标题和内容。

I need change the URL and postdata for each request. 我需要更改每个请求的URL和postdata。

About the page navigate, I have implement the method in AxWebBrowser_beforeNavigate2 , but it is no use for images, js, css etc. 关于页面导航,我已经在AxWebBrowser_beforeNavigate2中实现了该方法,但是对于图像,js,css等没有用。

And now, perhaps using Asynchronous Pluggable Protocol (APP) and override IInternetSession::RegisterNameSpace is required, but I have no experience on it. 现在,也许需要使用异步可插拔协议(APP)并覆盖IInternetSession :: RegisterNameSpace,但是我对此没有经验。

The Development Envrionment: .Net 2.0 , VS2008 开发环境:.Net 2.0,VS2008

Would someone give me some sample code for it ? 有人可以给我一些示例代码吗? thanks a lot. 非常感谢。

UrlMkSetSessionOption与INTERNET_OPTION_PROXY怎么样?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM