• Post Reply Bookmark Topic Watch Topic
  • New Topic

How is set the Proxy inside the Application

 
Anil Gopu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I am Writing a Small Application using AWT to fetch a URL ( Supplied by user ). To Fetch the URL by a USER behind a PROXY, how can a user suply the Proxy NAME / IP from a Dialog in my Application and use the same in my Application HOW CAN I DO THIS. I do not want to use the JAVA -DHttp options.

Thanx,
Anil
 
Pawel Veselov
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


------------------
With best of best regards, Pawel S. Veselov ( aka Black Angel )
 
Anil Gopu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u Pawel Veselov.
Regards,
Anil Gopu
 
Guhan Ramanan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Black angel aka Pawel
i tried the following code..
I still cant get out of the proxy.. I still see a host not found error..

import java.io.*;
import java.net.*;
import java.util.*;
class InetTest
{
public static void main(String args[]) throws Exception
{
Properties prop=System.getProperties();
System.out.println(prop);
prop.put("http.proxyHost","192.168.55.16");
prop.put("http.proxyPort","80");
Properties prop1=System.getProperties();
System.setProperties(prop1);
System.out.println(prop1);


InetAddress Address=InetAddress.getLocalHost();
String abcd=Address.getHostAddress();
InetAddress outsideAdd = InetAddress.getByName("www.hotmail.com");
String abcd12 = outsideAdd.getHostAddress();

System.out.println(outsideAdd);
System.out.println(Address);
}
}
The property gets added but nothing else happens...
Plz lemme know..
Guhan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!