Class Socks5ProxyConnector
java.lang.Object
org.apache.sshd.client.session.proxy.AbstractProxyConnector
org.apache.sshd.client.session.proxy.Socks5ProxyConnector
- All Implemented Interfaces:
Closeable, AutoCloseable
A
AbstractProxyConnector to connect through a SOCKS5 proxy.- See Also:
-
Field Summary
Fields inherited from class AbstractProxyConnector
done, proxyAddress, proxyPassword, proxyUser, remoteAddress -
Constructor Summary
ConstructorsConstructorDescriptionSocks5ProxyConnector(ProxyData proxy, InetSocketAddress remoteAddress, org.apache.sshd.common.util.io.functors.IOFunction<org.apache.sshd.common.util.buffer.Buffer, org.apache.sshd.common.io.IoWriteFuture> send, Function<InetSocketAddress, PasswordAuthentication> passwordAuth) Creates a newSocks5ProxyConnector. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.sshd.common.util.buffer.Bufferreceived(org.apache.sshd.common.util.Readable buffer) Processes incoming data, and returns aBuffercontaining any extra data frommessagethat was not yet processed.voidstart()Starts the proxy protocol by sending the initial connection request message to the proxy.Methods inherited from class AbstractProxyConnector
clearPassword, isDone, passwordAuthentication, write
-
Constructor Details
-
Socks5ProxyConnector
public Socks5ProxyConnector(ProxyData proxy, InetSocketAddress remoteAddress, org.apache.sshd.common.util.io.functors.IOFunction<org.apache.sshd.common.util.buffer.Buffer, org.apache.sshd.common.io.IoWriteFuture> send, Function<InetSocketAddress, PasswordAuthentication> passwordAuth) Creates a newSocks5ProxyConnector. The connector supports anonymous connections as well as username-password or Kerberos5 (GSS-API) authentication.- Parameters:
proxy-ProxyDataof the proxy we're connected toremoteAddress-InetSocketAddressof the target server to connect tosend- a function to send data and returning anIoWriteFuturepasswordAuth- a function to query the user for proxy credentials, if needed, and returning aPasswordAuthentication
-
-
Method Details
-
start
Description copied from class:AbstractProxyConnectorStarts the proxy protocol by sending the initial connection request message to the proxy.- Specified by:
startin classAbstractProxyConnector- Throws:
IOException- if the message cannot be sent
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classAbstractProxyConnector
-
received
public org.apache.sshd.common.util.buffer.Buffer received(org.apache.sshd.common.util.Readable buffer) throws Exception Description copied from class:AbstractProxyConnectorProcesses incoming data, and returns aBuffercontaining any extra data frommessagethat was not yet processed.- Specified by:
receivedin classAbstractProxyConnector- Parameters:
buffer- the received data- Throws:
Exception- if an error occurs
-