java.lang.Object
de.iip_ecosphere.platform.deviceMgt.ssh.Proxy
All Implemented Interfaces:
Runnable

public class Proxy extends Object implements Runnable
A basic transparent proxy implementation, which should be run in a thread. Main parts were acquired from https://github.com/oksuz/tcp-proxy (MIT)
Author:
oksuz, Github on 29/10/2017.
  • Field Details

    • LOGGER

      private static final de.iip_ecosphere.platform.support.logging.Logger LOGGER
    • in

      private final Socket in
    • out

      private final Socket out
  • Constructor Details

    • Proxy

      public Proxy(Socket in, Socket out)
      Creates a one-directional proxy between in and out.
      Parameters:
      in - Socket to get the data from
      out - Socket to pump the data into
  • Method Details

    • run

      public void run()
      This method basically pumps the data from in.getInputStream() to out.getOutputStream(), which creates a one-directional link between in and out.
      Specified by:
      run in interface Runnable
    • getInputStream

      private InputStream getInputStream()
      Returns the input stream.
      Returns:
      the input stream
    • getOutputStream

      private OutputStream getOutputStream()
      Returns the output stream.
      Returns:
      the output stream