Class Proxy

  extended by org.jgroups.util.Proxy

public class Proxy
extends java.lang.Object

Redirects incoming TCP connections to other hosts/ports. All redirections are defined in a file as for example
The first line forwards all requests to port 8888 on to at port 80 (it also forwards the HTTP response back to the sender. The second line essentially provides a POP-3 service on port 8110, using Yahoo's POP service. This is neat when you're behind a firewall and one of the few services in the outside world that are not blocked is port 80 (HHTP).
Note that JDK 1.4 is required for this class. Also, concurrent.jar has to be on the classpath. Note that you also need to include jsse.jar/jce.jar (same location as rt.jar) if you want SSL sockets.
To create SSLServerSockets you'll need to do the following: Generate a certificate as follows:
 keytool -genkey -keystore /home/bela/.keystore -keyalg rsa -alias bela -storepass  -keypass 
Start the Proxy as follows:
      org.jgroups.util.Proxy -file /home/bela/
Start client as follows:
 java sslclient

To import a certificate into the keystore, use the following steps:
 openssl x509 -in server.crt -out server.crt.der -outform DER
 keytool -import -trustcacerts -alias  -file server.crt.der
This will store the server's certificate in the ${user.home}/.keystore key store.
Note that an SSL client or server can be debugged by starting it as follows:

If you run a web browser, simply enter https://: as URL to connect to an SSLServerSocket
Note that we cannot use JDK 1.4's selectors for SSL sockets, as getChannel() on an SSL socket doesn't seem to work.

Note that this class is exoerimental and is not supported !

Bela Ban
To do:
Check whether SSLSocket.getChannel() or SSLServerSocket.getChannel() works.

Constructor Summary
Proxy( local, int local_port, remote, int remote_port, boolean verbose, boolean debug)
Proxy( local, int local_port, remote, int remote_port, boolean verbose, boolean debug, java.lang.String mapping_file)
Method Summary
static void main(java.lang.String[] args)
 void start()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Proxy( local,
             int local_port,
             int remote_port,
             boolean verbose,
             boolean debug)


public Proxy( local,
             int local_port,
             int remote_port,
             boolean verbose,
             boolean debug,
             java.lang.String mapping_file)
Method Detail


public void start()
           throws java.lang.Exception


public static void main(java.lang.String[] args)

Copyright © 1998-2009 Bela Ban / Red Hat. All Rights Reserved.