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.
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you provide a link that shows how SOCKS is supported in HttpClient 4?
http://old.nabble.com/Fw%3A-SOCKS-proxy-example---td28306808.html
Thanks for reporting, fixed in SVN
Awesome!
Thanks for adding this feature!
It solves me a big problem.
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.
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
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.
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.
Hi again,
Could you provide your proxy auto config file, and advise which URL goes/does not go through your HTTP proxy.
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.
Closing as per requester feedback, awaiting more issues :-)