how to set WebBrowser proxy

前端 未结 4 1606
别那么骄傲
别那么骄傲 2021-01-03 16:36

I am making a multi-threaded application. Each thread has its own WebBrowser control. I want to know how to set a different proxy for each WebBrowser. A custom WebBrowser th

相关标签:
4条回答
  • 2021-01-03 17:08

    Using unmanaged code it can be achieved, it may help:

    http://ryanfarley.com/blog/archive/2004/12/23/1330.aspx

    0 讨论(0)
  • 2021-01-03 17:11

    Since the WebBrowser is just an instance of the IE, it is impossible to set the Proxy for it. (Unless you tweak the registry, but it it's not individually)

    0 讨论(0)
  • Maybe another approach would be in order.

    You could spawn a WebRequest in the background threads and set a different proxy for each one. After you receive the data, then you can easily load it in a WebBrowser to play with it.

    0 讨论(0)
  • 2021-01-03 17:30

    As maor said, you won't be able to do a proxy per browser setup with WebBrowser. Instead, if you have control over the proxy, you might want to see what options it has for identifying a session (request/response). You might be able to, from the one proxy, tell which requests are probably coming from which WebBrowser controls depending on URLs and headers, etc.

    0 讨论(0)
提交回复
热议问题