hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley @MITRE.org" <DSMI...@mitre.org>
Subject SOCKS support is absent
Date Wed, 17 Nov 2010 15:03:48 GMT

I've been working with the HtmlUnit open source project to fix and enhance
its use of HttpClient (v4).  Given the extensive features of HttpClient, I
am very surprised to see that SOCKS support is absent.  I have to make
HtmlUnit do a bunch of things to get SOCKS proxies to work, particularly
https (SSL) layered over SOCKS.  I've searched this mailing list on this
subject to find that Oleg directs users to make a SocketFactory and *not*
mess with Routes.  I've also observed that ProxySelectorRoutePlanner
expressly ignores PROXY steps; and I'm not sure how code using this class
can detect if NO_PROXY is returned because of ignoring SOCKS or because of
no proxy being needed.  Can a comitter comment?

So I implement a SocketFactory.  Unfortunately I can't extend
PlainSocketFactory because its final, and this results in a bunch of
copy-pasted code with only a small change to pass a java.net.Proxy object to
Socket's constructor.  It's good to see that the v4.1 development release
passes HttpParams to createSocket(); I hope to eventually use that once v4.1
is released. SocketFactories are registered with HttpClient in association
with a scheme (e.g. http, https) and so I need to create two socket
factories, one plain, one SSL "layered", and register them.  I've gotten
this working for non-SSL and I'm going to work on the SSL case soon, for
HtmlUnit.

The bottom line is that not only does HttpClient not support SOCKS, it's
made it a pain to support it.  Can a committer comment if the lack of SOCKS
support is a deliberate long-term choice or has nobody scratched that itch
yet?  Ideally, I'd be working the the HttpClient committers to add SOCKS
support and not HtmlUnit; is that an option here?

~ David Smiley
-- 
View this message in context: http://old.nabble.com/SOCKS-support-is-absent-tp30238353p30238353.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


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


Mime
View raw message