Search code examples
javasocketsrmijava-web-start

Best way to tunnel RMI over HTTP


I'm looking for a secure way to tunnel RMI traffic. In My application(java Webstart) i must assume that the only port that is open is port 80.

I have the looked att socketfactories for rmi but do i really need a proxy then.

I need to do all my tunneling on the client side. The only firewall i am trying to get past is on the client side. I'm not able to open 1099 with port ranges above. Would be nice to see some implementations. Thanks!


Solution

  • Port 1099 was reserved for RMI at IANA in about 1995. There is no reason for it not to be open for outbound access in the client-side firewall.

    RMI can be made to use fixed port numbers by supplying a port number when constructing (super(port)) or exporting (exportObject(object, port)). Better still, if you create the Registry within the server JVM via LocateRegistry.createRegistry(), all subequently exported remote objects will use that port unless they specify a different port or they use a server socket factory.

    BUT ... RMI already includes HTTP tunneling 'out of the box'. No external solution required. You have to deploy the RMI-Servlet provided with the JDK, at the server end.