Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup proxy in AsyncHttpClient?

My app uses AsyncHttpClient library for network operation.My problem is i need to specify the proxy with port in order to connect to remote server.Any ideas to specify it??

like image 991
Tom Avatar asked Jul 02 '26 09:07

Tom


1 Answers

Try like this

 AsyncHttpClientConfig cf = new DefaultAsyncHttpClientConfig.Builder()
 .setProxyServer(new ProxyServer.Builder("127.0.0.1", 38080)).build();

 AsyncHttpClient c = new DefaultAsyncHttpClient(cf);
like image 59
akhil Rao Avatar answered Jul 05 '26 18:07

akhil Rao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!