java.lang.Object
net.i2p.sam.SAMv3StreamSession.SocketForwarder
- All Implemented Interfaces:
Runnable
- Enclosing class:
SAMv3StreamSession
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
FieldsModifier and TypeFieldDescriptionprivate final StringThe clearnet host to forward to.private final booleanTrue to connect to the host with SSL.private final intThe clearnet port to forward to.private final booleanTrue to report the ports in the replies.private final booleanTrue for extra logging.Constructor Summary
ConstructorsConstructorDescriptionSocketForwarder(String host, int port, boolean isSSL, boolean verbose, boolean sendPorts) Builds the forwarder for one clearnet connection.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidrun()Forward one incoming I2P connection to the SAM client until it closes.
Field Details
host
The clearnet host to forward to.port
private final int portThe clearnet port to forward to.isSSL
private final boolean isSSLTrue to connect to the host with SSL.verbose
private final boolean verboseTrue for extra logging.sendPorts
private final boolean sendPortsTrue 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 toport- the clearnet port to forward toisSSL- true to connect to the host with SSLverbose- true for extra loggingsendPorts- true to report the ports in the replies
Method Details
run