如何拦截WebBrowser的每个请求并转发给webproxy? [英] How to intercept each request of WebBrowser and forward to a webproxy?

查看:212
本文介绍了如何拦截WebBrowser的每个请求并转发给webproxy?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WinForm WebBrowser,我想将每个请求转发到我的Web代理并接收来自Web代理的响应,该Web代理会将响应直接转发给用户,包括标题和内容。

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.

我需要更改每个请求的URL和postdata。

I need change the URL and postdata for each request.

关于页面导航,我已经在AxWebBrowser_beforeNavigate2中实现了该方法,但是对于图像,js,css等没有用。

About the page navigate, I have implement the method in AxWebBrowser_beforeNavigate2 , but it is no use for images, js, css etc.

现在,也许使用异步可插拔协议(APP)并覆盖IInternetSession :: RegisterNameSpace是必需的,但我对此没有经验。

And now, perhaps using Asynchronous Pluggable Protocol (APP) and override IInternetSession::RegisterNameSpace is required, but I have no experience on it.

开发环境:.Net 2.0,VS2008

The Development Envrionment: .Net 2.0 , VS2008

有人会给我一些示例代码吗?

Would someone give me some sample code for it ? thanks a lot.

推荐答案

带有INTERNET_OPTION_PROXY的UrlMkSetSessionOption怎么样?

How about UrlMkSetSessionOption with INTERNET_OPTION_PROXY?

这篇关于如何拦截WebBrowser的每个请求并转发给webproxy?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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