简体   繁体   中英

Java HTTP and Proxies

I've been working on a Java project for some time and I've had a LOT of troubles with HTTP requests. My project works by sending requests, with different types of proxies. Currently I'm using OkHttp but it doesn't support SSL proxies natively and has some issues with SOCKS.

With OkHttp and SOCKS I get some exceptions like Malformed reply from SOCKS server .

My question is: is there a good Java HTTP library that supports HTTP/HTTPS/SOCKS proxies?

You can use AsyncHttpClient library or it's core library Netty, i recommend netty for specific development cases

Example usage for AsyncHttpClient http://www.baeldung.com/async-http-client just fill the proxy server parameters

Example netty usage is more understandable just change the Class type of proxy in the answer how to use Socks4/5 Proxy Handlers in Netty Client (4.1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM