Class AbstractProxyConnector
java.lang.Object
org.apache.sshd.client.session.proxy.AbstractProxyConnector
- All Implemented Interfaces:
Closeable, AutoCloseable
- Direct Known Subclasses:
HttpProxyConnector, Socks5ProxyConnector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final InetSocketAddressThe proxy address.protected char[]protected Stringprotected final InetSocketAddressThe ultimate remote address to connect to. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractProxyConnector(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 newAbstractProxyConnector. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidclose()booleanisDone()protected PasswordAuthenticationabstract org.apache.sshd.common.util.buffer.Bufferreceived(org.apache.sshd.common.util.Readable message) Processes incoming data, and returns aBuffercontaining any extra data frommessagethat was not yet processed.abstract voidstart()Starts the proxy protocol by sending the initial connection request message to the proxy.protected org.apache.sshd.common.io.IoWriteFuturewrite(org.apache.sshd.common.util.buffer.Buffer message)
-
Field Details
-
proxyAddress
The proxy address. -
remoteAddress
The ultimate remote address to connect to. -
proxyUser
-
proxyPassword
protected char[] proxyPassword -
done
protected boolean done
-
-
Constructor Details
-
AbstractProxyConnector
protected AbstractProxyConnector(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 newAbstractProxyConnector.- 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
-
write
protected org.apache.sshd.common.io.IoWriteFuture write(org.apache.sshd.common.util.buffer.Buffer message) throws IOException - Throws:
IOException
-
passwordAuthentication
-
clearPassword
protected void clearPassword() -
isDone
public boolean isDone() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
received
public abstract org.apache.sshd.common.util.buffer.Buffer received(org.apache.sshd.common.util.Readable message) throws Exception Processes incoming data, and returns aBuffercontaining any extra data frommessagethat was not yet processed.- Parameters:
message- the received data- Throws:
Exception- if an error occurs
-
start
Starts the proxy protocol by sending the initial connection request message to the proxy.- Throws:
IOException- if the message cannot be sent
-