olegk wrote:
>
> On Sun, 2010-07-04 at 11:39 -0700, Jacky-Zhu-1 wrote:
>> I've been trying to use httpclient4.0 to connect https server via socks
>> proxy, but it failed again and again.
>>
>
> SOCKS is a TCP/IP level, not HTTP level protocol. SOCKS proxy support
> can be configured using standard JVM settings.
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
Hi Oleg, thanks for your reply.
You are right, SOCKS proxy support could be configured using standard JVM
settings. But JVM settings is global, it will take effect for all the java
socket, this is not what we want, we just want to use SOCKS proxy for part
of the java sockets, so we want to go through the SOCKS by using HttpClient.
Yes, SOCKS is TCP/IP level, HttpClient focus on HTTP level. But HttpClient
supports to create customized socket by implementing the
SocketFactory/LayeredSocketFactory, am I right?
And JVM supports layered SSLSocket, I've checked the JVM code and the JSSE
code, JVM could support to let user pass one connected socket to one
SSLSocket.
So the solution I have tried is something like this:
1. create one normal socket, and connect it to the proxy server
2. complete the socks protocol using this socket
3. passed this socket to a new created SSLSocket
4. let HttpClient use this new SSLSocket to communicate with HTTPS server
I've checked the running status, the steps 1/2/3 are all ok, but the step 4
failed, as the log I have pasted.
Could you give me some advices?
Or maybe I can read the HttpClient source code to get some clues.
--
View this message in context:
http://old.nabble.com/How-to-use-httpclient4.0-to-connect-HTTPS-via-socks-proxy--tp29070494p29077304.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]