Class HttpProxyConnector
java.lang.Object
org.apache.sshd.client.session.proxy.AbstractProxyConnector
org.apache.sshd.client.session.proxy.HttpProxyConnector
- All Implemented Interfaces:
Closeable, AutoCloseable
Simple HTTP proxy connector supporting Basic and SPNEGO Authentication.
-
Field Summary
Fields inherited from class AbstractProxyConnector
done, proxyAddress, proxyPassword, proxyUser, remoteAddress -
Constructor Summary
ConstructorsConstructorDescriptionHttpProxyConnector(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 newHttpProxyConnector. -
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
-
HttpProxyConnector
public HttpProxyConnector(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 newHttpProxyConnector. The connector supports anonymous proxy connections as well as Basic and Negotiate (SPNEGO) 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
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classAbstractProxyConnector
-
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
-
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
-