Re: RMI app behind NAT firewall

Gregg Wonderly <[email protected]> Fri, 27 Jan 2006 09:52:23 -0600
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
Tobias Weih wrote:
> System.getProperties().put("java.rmi.server.hostname", HOST);
> Registry reg = LocateRegistry.createRegistry Registry.REGISTRY_PORT);
> Naming.rebind("//"+ HOST + ":1099/" + CommandBroker.NAME, this);

Anytime that you have a dual network identity like this, you have to use a DNS
host name when a publically routable network address is not visible on both
sides of the network.

So, on your local server, define your hostname using the local network address.
Outside, on the internet, define the hostname using the public ip address.
Users of your application might just place a definition of the mapping in there
"hosts" file (/etc/hosts on unix, c:\windows\system32\drivers\etc\hosts on
windows nt family OSes).  But, defining a DNS host entry would provide the least
amount of distributed management.

Gregg Wonderly

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html