Question

How can I use RMI with a applet client behind a firewall?

How can I use RMI with a firewalled server and firewalled applet client? (If possible)

I know that the RMI server uses port 1099 (by default, but this is configurable); however after this the communication requires a new socket on a different random port. I also know that you can set the proxy on the client for RMI over HTTP tunneling which in theory should solve my issue. But I can't make it work (I tried setting the environmental properties on my XP client, but Internet Explorer keeps ignoring them).

OTHER TIPS

If the servers code is in your hand you could also restrict RMI to use a predifined port by providing a custom RMISocketFactory as described here: http://insidecoffe.blogspot.com/2012/02/firewall-friently-rmi-port-fixing.html

(Note specially the hint that it may cause problems if you use JMX in parallel)

Have not looked into it to deeply my self yet, but while looking around for a project I am currently doing I came accross LipeRMI.

You might want to have a look at it as it geared towards internet usage and mentions "shadow the clients in such way they can be behind a local network, router or firewall;"

Edit:

Remembered another implementation I came across a while back called RMI Doves 1.0: Solution for Java RMI firewall problem you might want to have a look at that one as well.

in your Server put the code like this:

RmiInterface stub = (RmiInterface) UnicastRemoteObject.exportObject(rmi, 35400);
LocateRegistry.createRegistry(1099);
Naming.rebind("//192.168.102.128:1099/rmi", stub);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top