Using proxy in a JeditorPane browser
Hello,
I am making a Java browser which uses a proxy although when i go to google or any other site using this i get a 403 error - forbidden.
System.setProperty("proxySet", "true");
System.setProperty("http.proxyHost", "*******");
System.setProperty("http.proxyPort", "80");
I am using JeditorPane. Please could someone give the reason for this.
Is it by any chance to do with the user agent.
Cheers
John
[459 byte] By [
John4938a] at [2007-10-3 4:09:37]

import java.net.*;
import java.io.*;
public class ProxyTester
{
public static void main(String[] args) throws Exception
{
System.setProperty("proxySet", "true");
System.setProperty("http.proxyHost", "195.187.51.200");
System.setProperty("http.proxyPort", "80");
URL url = new URL("http://www.whatsmyip.org");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
while((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
Strange - still get a 403 error.
Is this the kind of application you meant?
Cheers