I'm having trouble using a Socket class to connect to another server when I'm behind our corporate proxy server. I'm getting an Exception detailing a "java.net.NoRouteToHostExc
eption: No route to host: connect" error.
The code I have is:
public class SocketTest
public static void main(String args)
System.setProperty( "proxySet", "true" );
System.setProperty( "http.proxyHost", "xx.xx.xx.xxx" );
System.setProperty( "http.proxyPort", "xxxx" );
URL url=new URL("http://xx.xx.xx.xxx
URLConnection uc = url.openConnection ();
String encoded = new String(base64Encode(new String("userName:password"
zation", "Basic " + encoded);
System.setProperty( "http.proxyUser", "userName" );
System.setProperty( "http.proxyPassword", "password" );
Socket s = new Socket("time-A.timefreq.bl
BufferedReader in = new BufferedReader(
boolean more = true;
String line = in.readLine();
if (line == null)
more = false;
Can't seem to get the thing to work. I don't know if it's of any relevence but just spoke to an IT guy who said that the proxy server acts an authentication server..the actual websweeper box is on NT, where all the filtering happens. I'm not too clued up on all of this proxy/firewall stuff so can anyone suggest anything I'm doing wrong?
Thanks in advance