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 Fri, 19 Jan 2007 16:28:23 GMT
I have some additional information on this.

As it turns out this does NOT really happen in 5.0 as I said in the report.
It can happen, but probably won't in realistic scenarios.

Webstart 5.0 reads its proxy settings from IE *always*, whether or not it is
the default.  Because of this, the behavior of the IE (to clear this field)
prevents this issue from happening.  Webstart 6.0 checks the default
browser's settings.  If the default browser is Firefox, which does not clear
the SOCKS proxy setting, connections will fail.

Mark
 
-----Original Message-----
From: Mark Claassen [mailto:mclaassen@ocie.net] 
Sent: Friday, January 19, 2007 10:45 AM
To: httpclient-user@jakarta.apache.org
Subject: HttpClient, SOCKS proxy, and webstart

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 summary:

Webstart gets its proxy settings from the Windows default browser

Have IE 7 be the default browser and set the proxy manually for all
protocols (including SOCKS) Run a webstart program that connects to anywhere
("http://java.sun.com" for
instance)

java.net.SocketException: Reply from SOCKS server has bad version
        at java.net.SocksSocketImpl.connectV4(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSo
cket(Unknown Source)

Now, in IE 7, check the box in the proxy settings to "Use same proxy for all
protocols"
This will actually cause IE to *clear* the SOCKS proxy box and the webstart
program will work.

Firefox, on the other hand, does not clear the SOCKS field when the
analogous check box is checked, cause HttpClient to fail to connect as
above.  This is the real problem and how I discovered it.  Since I use
Firefox, when I tested my Proxy, HttpClient failed...in a way it would not
have if I was using IE.  (I am assuming that most users will just check the
"Use same proxy for all protocols" in both browsers.)

I am not sure if this is a bug in Firefox, in the default SocketFactory, or
in HttpClient.  What I want to know is how to work around this.  I really
like HttpClient, but I am starting to get worried that as Firefox takes off
more and more, this is going to bite me.

P.S. 
HttpURLConnection seems to create its sockets from sun.net.NetworkClient and
not a SocketFactory, which apparently makes it immune to this problem


Thanks,
Mark



---------------------------------------------------------------------
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


Mime
View raw message