Package org.jgroups.util
Class Proxy
java.lang.Object
org.jgroups.util.Proxy
Redirects incoming TCP connections to other hosts/ports. All redirections are defined in a file as for example
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:
To import a certificate into the keystore, use the following steps:
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.
127.0.0.1:8888=www.ibm.com:80 localhost:80=pop.mail.yahoo.com:110The first line forwards all requests to port 8888 on to www.ibm.com 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 -storepassStart the Proxy as follows:-keypass
java -Djavax.net.ssl.keyStore=/home/bela/.keystore -Djavax.net.ssl.keyStorePassword=Start client as follows:-Djavax.net.ssl.trustStore=/home/bela/.keystore -Djavax.net.ssl.trustStorePassword= org.jgroups.util.Proxy -file /home/bela/map.properties
java -Djavax.net.ssl.trustStore=/home/bela/.keystore -Djavax.net.ssl.trustStorePassword=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 -aliasThis will store the server's certificate in the ${user.home}/.keystore key store.-file server.crt.der
Note that an SSL client or server can be debugged by starting it as follows:
-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -Djavax.net.debug=ssl
If you run a web browser, simply enter https://
Note that we cannot use JDK 1.4's selectors for SSL sockets, as getChannel() on an SSL socket doesn't seem to work.
- Author:
- Bela Ban
- To do:
- Check whether SSLSocket.getChannel() or SSLServerSocket.getChannel() works.
-
Constructor Summary
ConstructorsConstructorDescriptionProxy
(InetAddress local, int local_port, InetAddress remote, int remote_port, boolean verbose, boolean debug) Proxy
(InetAddress local, int local_port, InetAddress remote, int remote_port, boolean verbose, boolean debug, String mapping_file) -
Method Summary
-
Constructor Details
-
Proxy
public Proxy(InetAddress local, int local_port, InetAddress remote, int remote_port, boolean verbose, boolean debug) -
Proxy
public Proxy(InetAddress local, int local_port, InetAddress remote, int remote_port, boolean verbose, boolean debug, String mapping_file)
-
-
Method Details
-
start
- Throws:
Exception
-
main
-