Package org.apache.sshd.common.forward
Class SocksProxy
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.util.closeable.IoBaseCloseable
-
- org.apache.sshd.common.util.closeable.AbstractCloseable
-
- org.apache.sshd.common.forward.SocksProxy
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.nio.channels.Channel
,Closeable
,IoHandler
public class SocksProxy extends AbstractCloseable implements IoHandler
SOCKS proxy server, supporting simple socks4/5 protocols.- See Also:
- SOCKS Wikipedia
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SocksProxy.Proxy
class
SocksProxy.Socks4
class
SocksProxy.Socks5
-
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<IoSession,SocksProxy.Proxy>
proxies
private ConnectionService
service
-
Fields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, state
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description SocksProxy(ConnectionService service)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exceptionCaught(IoSession session, java.lang.Throwable cause)
void
messageReceived(IoSession session, Readable message)
void
sessionClosed(IoSession session)
void
sessionCreated(IoSession session)
-
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, doCloseGracefully, doCloseImmediately, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListener
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
-
-
-
Field Detail
-
service
private final ConnectionService service
-
proxies
private final java.util.Map<IoSession,SocksProxy.Proxy> proxies
-
-
Constructor Detail
-
SocksProxy
public SocksProxy(ConnectionService service)
-
-
Method Detail
-
sessionCreated
public void sessionCreated(IoSession session) throws java.lang.Exception
- Specified by:
sessionCreated
in interfaceIoHandler
- Throws:
java.lang.Exception
-
sessionClosed
public void sessionClosed(IoSession session) throws java.lang.Exception
- Specified by:
sessionClosed
in interfaceIoHandler
- Throws:
java.lang.Exception
-
messageReceived
public void messageReceived(IoSession session, Readable message) throws java.lang.Exception
- Specified by:
messageReceived
in interfaceIoHandler
- Throws:
java.lang.Exception
-
exceptionCaught
public void exceptionCaught(IoSession session, java.lang.Throwable cause) throws java.lang.Exception
- Specified by:
exceptionCaught
in interfaceIoHandler
- Throws:
java.lang.Exception
-
-