top button
Flag Notify
Site Registration

How to operate Java RMI through two firewalls?

+2 votes
How to operate Java RMI through two firewalls?
posted Sep 28, 2013 by Vinay Shukla

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

The client side firewall allows no direct TCP connections & has only a HTTP proxy server so that firewalled clients can surf the web. In this case, your server host 'll receive connections at port 80 containing Java RMI requests embedded in HTTP requests. You can use a HTTP server with the java-rmi.cgi program or you can run the Java RMI server directly on port 80. Either way, the server cannot use callback objects exported by the clients.

A more optimistic case is that the client can make direct connections to the server but cannot receive incoming connections from the server. In this case, callback objects are not normally possible either.

The most conservative approach, assuming no help from the client firewall administrators is:-
1.Avoid using callback objects
2.Run your servers on `public' ports such as 80, 81, 8001, or 443
3.If the servers are not running on port 80, either:
a)Put a CGI-capable HTTP server on port 80 using the java-rmi.cgi script; or
b)Run a port redirector (such as DeleGate) on port 80, which will accept connections and immediately connect to the real server port to pass bytes back and forth. This will cause getClientHost() to return misleading information, so don't make the Registry available through this method unless it's on a different host.

answer Sep 28, 2013 by Arvind Singh
Similar Questions
+4 votes

Is it advisable to use System.exit() for graceful client termination?

0 votes

In my Android system, if I want to setup up some network traffic rules sort of like a firewall to disallow certain access points should I use iptables for this. What is the best approach to do something like this?