Bypass proxy to access local network URLs

A

ash_mod2

Dears,
I have a web application deployed on application server Oracle 9i
AppServer -I don't think the application server has

anything to do with my problem-, it calls other web application through
HTTP, on the local network, the other application

servers are hosted on windows platform and/or Unix platform.

All these machine can access Internet through proxy server, but there
are no proxy or firewalls between them, so everything

is openned between the machines in the local network.

When I try to connect from one machine to another using the following
code, I find that it always request proxy

authentication, which I would like to bypass.
The error says: http request returned error code 407


package com.rsw.common.net;

import java.net.*;
import java.io.*;
import java.util.Properties;
public class UrlConnector
{
public void connect(String url,String[] params, String[] values )
{
try
{
URL l_URL = new URL(url);
URLConnection l_URLConnection = l_URL.openConnection();
l_URLConnection.setDoOutput(true);
l_URLConnection.setDoInput(true);
l_URLConnection.setUseCaches(false);
l_URLConnection.setRequestProperty("Method", "POST");
PrintWriter l_PrintWriter = new
PrintWriter(l_URLConnection.getOutputStream());
String l_szParams ="";
if(params!=null)
{
if(params.length >=1)
l_szParams=params[0]+"="+URLEncoder.encode(values[0]);

for(int i=1;i<params.length;i++)

l_szParams+="&"+params+"="+URLEncoder.encode(values);

l_PrintWriter.println(l_szParams);
}
l_PrintWriter.close();
BufferedReader l_BufferedReader = new BufferedReader(new
InputStreamReader(l_URLConnection.getInputStream()));
String l_szResponseLine = "";
String l_szURLResponse;
for ( l_szURLResponse = "";
(l_szResponseLine = l_BufferedReader.readLine()) != null;
l_szURLResponse = l_szURLResponse + l_szResponseLine
);

l_BufferedReader.close();
System.out.println(l_szURLResponse);
}
catch(Exception l_exception)
{
System.out.println(l_exception.getMessage());
}
}
}


I found that what I need is similar to setting in Internet Explorer to
bypass proxy for addresses starting with ..... :) But

I don't know how to apply this to my code? :( I'm using JDK 1.3.1

Anyone can help, I'm open to use any libary that overcome this problem.

Thanks, in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,733
Latest member
LonaMonzon

Latest Threads

Top