|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.io.http.HttpTunnel
public class HttpTunnel
Simple HTTP tunnel base ready to be extended.
| Nested Class Summary | |
|---|---|
class |
HttpTunnel.HttpTunnelConnection
Single connection handler that performs the tunneling. |
| Field Summary | |
|---|---|
protected java.util.concurrent.ExecutorService |
executorService
|
protected int |
listenPort
Tunnel listening port. |
protected boolean |
running
|
protected java.net.ServerSocket |
serverSocket
|
protected int |
socketBacklog
Number of incoming sockets connection that can be hold before processing each. |
protected java.lang.String |
targetHost
Target host. |
protected int |
targetPort
Target port. |
protected int |
threadPoolSize
The number of threads that can be executed in parallel. |
| Constructor Summary | |
|---|---|
HttpTunnel()
|
|
| Method Summary | |
|---|---|
protected java.lang.Runnable |
onSocketConnection(java.net.Socket socket)
Invoked on incoming connection. |
void |
start()
Starts HTTP tunnel. |
void |
stop()
Stops the tunnel, shutdowns the thread pool and closes server socket. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int threadPoolSize
protected int socketBacklog
protected int listenPort
protected java.lang.String targetHost
protected int targetPort
protected java.util.concurrent.ExecutorService executorService
protected boolean running
protected java.net.ServerSocket serverSocket
| Constructor Detail |
|---|
public HttpTunnel()
| Method Detail |
|---|
public void start()
throws java.io.IOException
java.io.IOExceptionprotected java.lang.Runnable onSocketConnection(java.net.Socket socket)
HttpTunnel.HttpTunnelConnection
to handle the connection. May be used to return custom
handlers.
public void stop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||