Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proxy Problems

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i am a student and i am developing a java application
that needs to communicate via a proxy. i am at the
moment following the procedures found on the site
rgagnon.com and many other java sites. they all say
the same. my problem is that even with that code i am
not able to create a socket with the remote host. the
error it gives is unknownhostexception. the host i am
trying to access does exist(infact i tried to connect
various other sites like hotmail and yahoo). also my
proxy is running perfectly, since other application
and my browsers are all running perfectly.
the code i am trying is as follows

import java.net.*;
import java.io.*;
import java.util.*;
public class proxytry
{
public proxytry()
{
try{
Properties systemsettings=System.getProperties();
systemsettings.put("proxySet","true");
systemsettings.put("proxyHost","vinay");
systemsettings.put("proxyPort","81");
System.setProperties(systemsettings);
Socket s=new Socket("jabber.com",5222);
}
catch(Exception e){System.out.println("Error:-"+e);}



}
public static void main(String args[])
{
proxytry p=new proxytry();
}


}




my proxy machine name is vinay and the http proxy is
running on port 81. my remote host also runs on port
5222.

hope u help me
waiting for ur reply
thanx
abbas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top