Login | Register   
Twitter
RSS Feed
Download our iPhone app
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
Nov 25, 2008

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 Base64
String s = new sun.misc.BASE64Encoder().encode(x); 
URLcon.setRequestProperty( "Proxy-Authorization",s);
Leonard Anghel
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap