How to use Socks 5 proxy with Apache HTTP Client 4?
SOCK is a TCP/IP level proxy protocol, not HTTP. It is not supported by HttpClient out of the box. One can customize HttpClient to establish connections via a SOCKS proxy by using a custom connection socket factory EDIT: changes to SSL instead of plain sockets Registry<ConnectionSocketFactory> reg = RegistryBuilder.<ConnectionSocketFactory>create() .register(“http”, PlainConnectionSocketFactory.INSTANCE) .register(“https”, new MyConnectionSocketFactory(SSLContexts.createSystemDefault())) .build(); … Read more