1

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 that supports a proxy per instance will be a good solution to me as well.

dlock
  • 9,447
  • 9
  • 47
  • 67
  • 2
    You have multiple UI threads? How did you do that? – John Saunders Dec 26 '10 at 18:07
  • They ain't UI threads. They are a sort of background workers. I initialize 1 WebBrowser object (new WebBrowser();) on each thread and do specific tasks. – dlock Dec 26 '10 at 18:15
  • 1
    WebBrowser objects are visual components. If you're just sending requests and receiving responses, you'd do better with WebRequest object. – AviD Jan 09 '11 at 17:11
  • can you create the webbrowser controls in different processes? WinInet settings are process-wide, so do WinInet sessions. – Sheng Jiang 蒋晟 Jan 11 '11 at 21:46
  • This idea is so crazy it *just might work*. :-) – MusiGenesis Jan 12 '11 at 00:42
  • @deadlock: Did you got this running?? If yes, then could you please provide information about how you did it. I am trying to do the same thing, but in C++. – Arpit Sep 23 '15 at 14:17

4 Answers4

3

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.
Ovi
  • 2,620
  • 7
  • 34
  • 51
1

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)

maor
  • 86
  • 1
0

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.

Chad
  • 3,159
  • 4
  • 33
  • 43
0

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

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

ShahidAzim
  • 1,446
  • 1
  • 10
  • 15