hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Claassen <mclaas...@ocie.net>
Subject RE: HttpClient, SOCKS proxy, and webstart
Date Tue, 23 Jan 2007 17:11:55 GMT
Thanks for the advice.  Right now I am going to wait a bit and see what Sun
will say in the bug report I submitted. 

The class sun.net.NetworkClient just basically creates a new socket via
Socket() or Socket(Proxy p).  Inefficiencies aside, could I just create a
SocketFactory that just creates a new socket every time?  Since it seems
that HttpClient manages the proxies and all that, it seems I would not need
to bother with that.  All I would need to do is to create a new Socket with
the constructor arguments that match the createSocket(...) methods.  (And
set options based on the HttpConnectionParams.)

Like I said, hopefully Sun will address the issue with some ideas of their
own.  But, barring that, is the SocketFactory I mentioned above technically


-----Original Message-----
From: Roland Weber [mailto:http-async@dubioso.net] 
Sent: Saturday, January 20, 2007 10:58 AM
To: HttpClient User Discussion
Subject: Re: HttpClient, SOCKS proxy, and webstart

Hi Mark,

> I have been having some trouble with HttpClient and the SOCKS proxy.  
> My path to where I am now is a long and sorted tale, so here is my
> Webstart gets its proxy settings from the Windows default browser

Your problem is a new twist to the "proxy configuration" discussion in the
application design FAQ:

Unlike HTTP proxy settings, SOCKS is not directly in scope for HttpClient:

> I am not sure if this is a bug in Firefox, in the default 
> SocketFactory, or in HttpClient.

It's a bug in Webstart, or in the Firefox/Webstart interaction. I don't know
whether Webstart can determine whether Firefox's checkbox is set

> What I want to know is how to work around this.
> HttpURLConnection seems to create its sockets from 
> sun.net.NetworkClient and not a SocketFactory, which apparently makes 
> it immune to this problem

I don't see how we could work around this in HttpClient. However, socket
creation in HttpClient is explicitly encapsulated in SocketFactories:

Maybe you can implement your own socket factory which calls
sun.net.NetworkClient? If it is possible, and if you can live with calling
SUN internal classes, that should make your app immune to this problem as

hope that helps,

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message