java.lang.Object
net.i2p.sam.SAMv3StreamSession.SocketForwarder
All Implemented Interfaces:
Runnable
Enclosing class:
SAMv3StreamSession

private class SAMv3StreamSession.SocketForwarderextends Object implements Runnable
Forwards incoming I2P connections to a local TCP host:port. Runs in its own thread, accepting from the I2P server socket and connecting to the local forwarding target. Each accepted I2P socket is bridged to the local socket via SAMv3StreamSession.Pipe.

Created by the FORWARD command handler. Only one forwarder may be active per session at a time.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
    The clearnet host to forward to.
    private final boolean
    True to connect to the host with SSL.
    private final int
    The clearnet port to forward to.
    private final boolean
    True to report the ports in the replies.
    private final boolean
    True for extra logging.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SocketForwarder(String host, int port, boolean isSSL, boolean verbose, boolean sendPorts)
    Builds the forwarder for one clearnet connection.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    void
    run()
    Forward one incoming I2P connection to the SAM client until it closes.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • host

      private final String host
      The clearnet host to forward to.
    • port

      private final int port
      The clearnet port to forward to.
    • isSSL

      private final boolean isSSL
      True to connect to the host with SSL.
    • verbose

      private final boolean verbose
      True for extra logging.
    • sendPorts

      private final boolean sendPorts
      True to report the ports in the replies.
  • Constructor Details

    • SocketForwarder

      SocketForwarder(String host, int port, boolean isSSL, boolean verbose, boolean sendPorts)
      Builds the forwarder for one clearnet connection.
      Parameters:
      host - the clearnet host to forward to
      port - the clearnet port to forward to
      isSSL - true to connect to the host with SSL
      verbose - true for extra logging
      sendPorts - true to report the ports in the replies
  • Method Details

    • run

      public void run()
      Forward one incoming I2P connection to the SAM client until it closes.
      Specified by:
      run in interface Runnable