Top Description Inners Fields Constructors Methods
org.apache.sshd.common.forward

public Class SocksProxy

extends AbstractCloseable
implements IoHandler
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.io.IoHandler
Imports
java.io.Closeable, .IOException, java.util.Map, java.util.concurrent.ConcurrentHashMap, org.apache.sshd.client.future.OpenFuture, org.apache.sshd.common.SshException, org.apache.sshd.common.channel.StreamingChannel.Streaming, org.apache.sshd.common.io.IoHandler, .IoSession, org.apache.sshd.common.session.ConnectionService, org.apache.sshd.common.util.buffer.Buffer, .ByteArrayBuffer, org.apache.sshd.common.util.closeable.AbstractCloseable, org.apache.sshd.common.util.net.SshdSocketAddress, org.apache.sshd.common.util.threads.ThreadUtils

SOCKS proxy server, supporting simple socks4/5 protocols.
Author
Apache MINA SSHD Project
See Also
SOCKS Wikipedia

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
public class
public class

Field Summary

Modifier and TypeField and Description
private final Map<IoSession, SocksProxy.Proxy>
private final ConnectionService
Inherited from org.apache.sshd.common.util.closeable.AbstractCloseable:
closeFuturefutureLockstate

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
Inherited from org.apache.sshd.common.util.closeable.AbstractCloseable:
addCloseFutureListenerbuilderclosedoCloseGracefullydoCloseImmediatelygetFutureLockisClosedisClosingpreCloseremoveCloseFutureListener

Field Detail

proxiesback to summary
private final Map<IoSession, SocksProxy.Proxy> proxies
serviceback to summary
private final ConnectionService service

Constructor Detail

SocksProxyback to summary
public SocksProxy(ConnectionService service)

Method Detail

exceptionCaughtback to summary
public void exceptionCaught(IoSession session, Throwable cause) throws Exception

Implements org.apache.sshd.common.io.IoHandler.exceptionCaught.

Annotations
@Override
messageReceivedback to summary
public void messageReceived(IoSession session, Readable message) throws Exception

Implements org.apache.sshd.common.io.IoHandler.messageReceived.

Annotations
@Override
sessionClosedback to summary
public void sessionClosed(IoSession session) throws Exception

Implements org.apache.sshd.common.io.IoHandler.sessionClosed.

Annotations
@Override
sessionCreatedback to summary
public void sessionCreated(IoSession session) throws Exception

Implements org.apache.sshd.common.io.IoHandler.sessionCreated.

Annotations
@Override
org.apache.sshd.common.forward back to summary

public abstract Class SocksProxy.Proxy

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
org.apache.sshd.common.forward.SocksProxy.Socks4, org.apache.sshd.common.forward.SocksProxy.Socks5

Field Summary

Modifier and TypeField and Description
protected TcpipClientChannel
protected IoSession

Constructor Summary

AccessConstructor and Description
protected
Proxy(IoSession session)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

protected int
getUByte(Buffer buffer)

protected int
getUShort(Buffer buffer)

protected void
onMessage(Buffer buffer)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

channelback to summary
protected TcpipClientChannel channel
sessionback to summary
protected IoSession session

Constructor Detail

Proxyback to summary
protected Proxy(IoSession session)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
getUByteback to summary
protected int getUByte(Buffer buffer)
getUShortback to summary
protected int getUShort(Buffer buffer)
onMessageback to summary
protected void onMessage(Buffer buffer) throws IOException
org.apache.sshd.common.forward back to summary

public Class SocksProxy.Socks4

extends Proxy
Class Inheritance

See Also
SOCKS4

Field Summary

Inherited from org.apache.sshd.common.forward.SocksProxy.Proxy:
channelsession

Constructor Summary

AccessConstructor and Description
public
Socks4(IoSession session)

Method Summary

Modifier and TypeMethod and Description
protected String
protected void
protected void
Inherited from org.apache.sshd.common.forward.SocksProxy.Proxy:
closegetUBytegetUShort

Constructor Detail

Socks4back to summary
public Socks4(IoSession session)

Method Detail

getNTStringback to summary
protected String getNTString(Buffer buffer)
onChannelOpenedback to summary
protected void onChannelOpened(OpenFuture future)
Annotations
@SuppressWarnings:synthetic-access
onMessageback to summary
protected void onMessage(Buffer buffer) throws IOException

Overrides org.apache.sshd.common.forward.SocksProxy.Proxy.onMessage.

Annotations
@SuppressWarnings:synthetic-access
@Override
org.apache.sshd.common.forward back to summary

public Class SocksProxy.Socks5

extends Proxy
Class Inheritance

See Also
SOCKS5

Field Summary

Modifier and TypeField and Description
private byte[]
private Buffer
Inherited from org.apache.sshd.common.forward.SocksProxy.Proxy:
channelsession

Constructor Summary

AccessConstructor and Description
public
Socks5(IoSession session)

Method Summary

Modifier and TypeMethod and Description
protected String
protected void
protected void
Inherited from org.apache.sshd.common.forward.SocksProxy.Proxy:
closegetUBytegetUShort

Field Detail

authMethodsback to summary
private byte[] authMethods
responseback to summary
private Buffer response

Constructor Detail

Socks5back to summary
public Socks5(IoSession session)

Method Detail

getBLStringback to summary
protected String getBLString(Buffer buffer)
onChannelOpenedback to summary
protected void onChannelOpened(OpenFuture future)
Annotations
@SuppressWarnings:synthetic-access
onMessageback to summary
protected void onMessage(Buffer buffer) throws IOException

Overrides org.apache.sshd.common.forward.SocksProxy.Proxy.onMessage.

Annotations
@SuppressWarnings:synthetic-access
@Override