Peter Duniho schrieb:Have you resolved this problem?
On Sat, 18 Apr 2009 19:47:08 -0700, Christian <fake...@xyz.de> wrote:
[...]
My hope was that there was sort of an alike way to handle Proxys
without having to change all code where SocketChannels are in use.
There just is no .connect() method for socketChannel that allows for a
proxy..
Well, I admit I haven't used it. But as I mentioned, it appears to me
that you can use the ProxySelector class (or more specifically, your own implementation of the class) to globally direct all Socket i/o to use a particular proxy server.
I agree that the restriction on SocketChannel, where (as the docs say)
"It is not possible to create a channel for an arbitrary, pre-existing socket", means you can't construct a Socket to use a specific proxy.
But as long as you can deal with setting it on a global basis (at least temporarily, while you create the SocketChannel you need), it seems like it would work.
PeteProblem I have is: SocketChannel seems to ignore global settings.
It just doesn't work here.
Christian
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 374 |
Nodes: | 16 (2 / 14) |
Uptime: | 11:33:31 |
Calls: | 7,967 |
Calls today: | 1 |
Files: | 13,011 |
Messages: | 5,815,218 |