how to esteblish a socket connection through the firewall!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   tonewoo_woods
Posted On:   Monday, June 25, 2001 10:53 PM

establish a socket connection through the firewall and bind a server with it's port but it can't read from the server,throws exception,pls help me! best regards. public class SocketTest { public static void main(String[] args) { String line = null; System.getProperties().put( "socksProxySet", "true" ); System.getProperties().put( "socksProxyHost", "192.168.148.26"); System.getProperties().put( "socksProxyPort", "1080"); try { InetAddress aIp = InetAddress.getByName("210.176.51.135");    More>>

establish a socket connection

through the firewall and bind a

server with it's port but it can't

read from the server,throws

exception,pls help me!

best regards.


public class SocketTest

{

public static void main(String[] args)
{

String line = null;

System.getProperties().put( "socksProxySet", "true" );

System.getProperties().put( "socksProxyHost", "192.168.148.26");

System.getProperties().put( "socksProxyPort", "1080");

try
{

InetAddress aIp = InetAddress.getByName("210.176.51.135");

System.out.println("The hosta ip: " + aIp.getHostAddress());

Socket s = new Socket(aIp,80);

s.setSoTimeout(20000);

BufferedReader in = new BufferedReader

(new InputStreamReader(s.getInputStream()));

while ((line = in.readUTF()) != null)
{

System.out.println(line);

}

}

catch (IOException e)
{

System.out.println("Error" + e);

}

}

}

   <<Less

Re: how to esteblish a socket connection through the firewall!

Posted By:   Tim_Rohaly  
Posted On:   Tuesday, June 26, 2001 12:37 AM

You don't say what the exception is, so how can we tell
you what's wrong?
My guess is you don't have a SOCKS V4 proxy running
or don't have it configured properly. You should read the
FAQ and Forum entries about proxies. And by the way,
there is no such property as socksProxySet.
About | Sitemap | Contact