Menu

#236 UIL - Add support for NAT

open-accepted
nobody
None
5
2002-09-10
2002-06-10
No

The UILServerIL object currently connects based on the IP
address sent by the server. In environments where the
server and client are on different sides of a firewall with
Network Address Translation (NAT), this approach fails.

I have modified the createConnection() method to read the
servername from the InetAddress object sent by the server
and construct the IP address locally as follows:

protected void createConnection()
throws Exception {
// old way -> Socket socket = new Socket( addr, port );
String hostName = addr.getHostName();
InetAddress address = InetAddress.getByName
(hostName);
Socket socket = new Socket( address, port );

mSocket = new SocketMultiplexor( socket );
out = new ObjectOutputStream( new
BufferedOutputStream( mSocket.getOutputStream( 1 ) ) );
out.flush();
in = new ObjectInputStream( new BufferedInputStream(
mSocket.getInputStream( 1 ) ) );
}

I'm sure that there are situations where the old way is
desireable so this should be made a configuration option
through the UILServerILServiceMBean.

Please contact me to help with this implementation if
needed.

Howard
howard_ungar@yahoo.com

Discussion

  • Juha Lindfors

    Juha Lindfors - 2002-09-10
    • status: open --> open-accepted
     
  • Juha Lindfors

    Juha Lindfors - 2002-09-10
    • labels: 372166 -->
    • milestone: 158700 -->
     

Log in to post a comment.