Authenticate to a Proxy Server

To provide a user’s password to a proxy server, use the following code:

URLConnection URLcon=null;URLcon = url.openConnection();byte[] x="name:password".getBytes();//coding in Base64String s = new sun.misc.BASE64Encoder().encode(x); URLcon.setRequestProperty( "Proxy-Authorization",s);
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: