Menu

#169 socks proxy support

closed
None
5
2012-10-21
2010-05-24
No

Can htmlunit support socks proxy now?
I found htmlunit-2.8-SNAPSHOT had used httpclient4.0.1,and httpclient4.0.1 supports socks proxy via thread.
Can htmlunit add this feature?
Thanks.

Discussion

  • Ahmed Ashour

    Ahmed Ashour - 2010-05-24

    Can you provide a link that shows how SOCKS is supported in HttpClient 4?

     
  • Ahmed Ashour

    Ahmed Ashour - 2010-05-29

    Thanks for reporting, fixed in SVN

     
  • shirley wilder

    shirley wilder - 2010-05-31

    Awesome!
    Thanks for adding this feature!
    It solves me a big problem.

     
  • David Smiley

    David Smiley - 2010-06-17

    The addition of the SocksSocketFactory I see in the committed code for this issue should only happen when webRequest.isSocksProxy() == true. Instead, this socket factory is always registered. I am trying out an upgrade to the 2.8-SNAPSHOT from v2.7 and this factory isn't able to create sockets connecting to my sites. I have an environment involving http proxies including an auto-proxy setup.

     
  • Ahmed Ashour

    Ahmed Ashour - 2010-06-17

    Hi David,

    SocksSocketFactory may or may not create SOCKS Sockets (see #createSocket())

    It is meant to override the default SocketFactory, but only uses SOCKS if webRequest.isSocksProxy(), have a look in HttpWebConnection.setProxy

    I tested its behavior locally, please provide more details of your environment, and how to reproduce the error you encounter

     
  • David Smiley

    David Smiley - 2010-06-17

    I already explained my environment, asashour. Again, it includes an http proxy as well as an auto-proxy script. This worked in 2.7 bot doesn't in 2.8. I have seen the logic you speak of. The problem is that this SocksSocketFactory only constructs sockets going directly to the site, not those that understand http proxy servers. If this special socket factory was only installed when the need to do SOCKS is there, then presumably Java's internal one which has support for http proxies will kick in.

     
  • David Smiley

    David Smiley - 2010-06-24

    Is there anything I can do to get this resolved? I could create a patch to HttpWebConnection to only install the SocksSocketFactory if socks is asked for but not otherwise.

     
  • Ahmed Ashour

    Ahmed Ashour - 2010-07-09

    Hi again,

    Could you provide your proxy auto config file, and advise which URL goes/does not go through your HTTP proxy.

     
  • David Smiley

    David Smiley - 2010-07-12

    I withdraw my concern. Either the trunk is now updated in some fashion to not have this problem for me (I've seen commits in the vicinity of SOCKS / proxies) or the error I saw confused me and led me to believe it was this SOCKS support code when it was not. I am seeing another issue related to http proxies that I know the fix for and I'll report that separately in a minute. Thanks asashour.

     
  • Ahmed Ashour

    Ahmed Ashour - 2010-07-12

    Closing as per requester feedback, awaiting more issues :-)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.