File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes Getting out of a proxy server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Getting out of a proxy server" Watch "Getting out of a proxy server" New topic

Getting out of a proxy server

Guhan Ramanan

Joined: Jun 29, 2000
Posts: 7
I have a proxyserver called PROXYSERVER and that is connected to the Net.
I tried the following code and it gave me a UnknownHostException. How do i resolve it?
// Code follows
import java.util.*;
class InetTest
public static void main(String args[]) throws Exception
Properties prop=System.getProperties();
Properties prop1=System.getProperties();

InetAddress Address=InetAddress.getLocalHost();
String abcd=Address.getHostAddress();
//String abcd = InetAddress.getHostName();

Address = InetAddress.getByName("");
I get local host name and the property has been added but still there is the exception.
Plz help..

<B> Guhan Ramanan </B><BR>Sun certified Programmer for Java2 Platform
Sandeep Jain
Ranch Hand

Joined: Oct 25, 2000
Posts: 124
Even I had the same problem earlier . But after installing the microsoft proxy client on to my system, the program worked perfectly without any problem .
Try installing the proxy client from ur server . Its a software that is available on the server . In case you are unable to undestand what is the funda behind the proxy client .Contact ur server administrator he will install it for u .

Sandeep Jain

Try and Try Till u succeed<br /> <br />Sandeep Jain
I agree. Here's the link:
subject: Getting out of a proxy server
It's not a secret anymore!