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
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