|
-
September 19th, 2000, 02:30 PM
#1
How to use Java with MS Proxy Server
I am trying to get my application to connect to
the WWW thru Microsoft Proxy Server 2.0, but can't
get beyond the firewall. The following is the
relevant code snippet. Any suggestions...I'm
going bonkers!!!
Properties prop = System.getProperties();
prop.put("proxySet", "true" );
prop.put("proxyHost","name.of.proxy.server");
prop.put("proxyPort","80");
String password = "userid assword";
String encodedPassword = "Basic " + Codecs.base64Encode( password.getBytes() );
URL url = new URL("http://www.netscape.com/");
URLConnection connection = url.openConnection();
connection.setRequestProperty( "Proxy-Authorization",encodedPassword );
connection.setRequestProperty( "Proxy-Authentication",encodedPassword );
connection.setDoInput( true );
bfr = new BufferedReader(new InputStreamReader(connection.getInputStream()));
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|