dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Intermediate
Oct 2, 2019

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Setting a Proxy in Java

Let's assume that we have a proxy at address proxy.host:8888. We can set up this proxy via the JDK 11 HttpClient as follows:

HttpClient client = HttpClient.newBuilder()
   .proxy(ProxySelector.of(new InetSocketAddress("proxy.host", 8888)))
   .build();
Octavia Anghel
 
Thanks for your registration, follow us on our social networks to keep up-to-date