views:

465

answers:

1

Hi All

I'm attempting to connect through a SOCKS5 proxy to a webservice. Currently, my app.config is as follows:

<system.net>
 <defaultProxy enabled="true"  >
  <proxy proxyaddress="http://xxx.xxx.xxx.xxx:yyyy" bypassonlocal="True" />
 </defaultProxy>
</system.net>

This works fine for http proxies, however it just doesn't connect to SOCKS5 ones. I've googled far and wide for an answer and just can't find anyone that's solved this problem, even though I've found the question a couple of times. Anyone have any idea on how I can do this?

+2  A: 

Apparently Microsoft did not build SOCKS proxy support into their web classes (see http://windows-tech.info/13/f17246e7dd4a8a2b.php)

I too am in a situation where I'd like to use the built-in .NET web functionality with a SOCKS5 proxy, and have not found any satisfactory solution. I guess my next step is to obtain the source of the .NET classes either through Reflector or from the Mono codebase and refactor it to use the ProxySocket class mentioned in the above link.

This is more work than I wanted, but seems to be the only way.

Takuan Daikon
Any luck with that? We are having the same problem (Mentalis ProxySocket works at the Socket level), and are considering the same (ugly) workaround.
Groo
I'm sorry to say that I have not found a satisfactory solution to this. Because we have postponed the requirement for the short term, I've not yet been forced to try the workaround, so I cannot say with any certainty whether it will even work.
Takuan Daikon