public class HttpTunnel
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
HttpTunnel.HttpTunnelConnection
Single connection handler that performs the tunneling.
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
HttpTunnel() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected int threadPoolSize
protected int socketBacklog
protected int listenPort
protected java.lang.String targetHost
protected int targetPort
protected java.util.concurrent.ExecutorService executorService
protected volatile boolean running
protected java.net.ServerSocket serverSocket
public void start() throws java.io.IOException
java.io.IOException
protected java.lang.Runnable onSocketConnection(java.net.Socket socket)
HttpTunnel.HttpTunnelConnection
to handle the connection. May be used to return custom
handlers.public void stop()
Copyright © 2003-present Jodd Team