Class HttpTunnel

java.lang.Object
jodd.http.HttpTunnel

public class HttpTunnel extends Object
Simple HTTP tunnel base ready to be extended.
  • Field Details

    • threadPoolSize

      protected int threadPoolSize
      The number of threads that can be executed in parallel.
    • socketBacklog

      protected int socketBacklog
      Number of incoming sockets connection that can be hold before processing each.
    • listenPort

      protected int listenPort
      Tunnel listening port.
    • targetHost

      protected String targetHost
      Target host.
    • targetPort

      protected int targetPort
      Target port.
    • executorService

      protected ExecutorService executorService
    • running

      protected volatile boolean running
    • serverSocket

      protected ServerSocket serverSocket
  • Constructor Details

    • HttpTunnel

      public HttpTunnel()
  • Method Details

    • start

      public void start() throws IOException
      Starts HTTP tunnel. Method ends when the tunnel is stopped.
      Throws:
      IOException
    • onSocketConnection

      protected Runnable onSocketConnection(Socket socket)
      Invoked on incoming connection. By default returns HttpTunnel.HttpTunnelConnection to handle the connection. May be used to return custom handlers.
    • stop

      public void stop()
      Stops the tunnel, shutdowns the thread pool and closes server socket.