public class HttpClientConnector extends AbstractClientProxyConnector
Modifier and Type | Class and Description |
---|---|
private static interface |
HttpClientConnector.HttpAuthenticationHandler |
private class |
HttpClientConnector.HttpBasicAuthentication |
private class |
HttpClientConnector.NegotiateAuthentication |
Modifier and Type | Field and Description |
---|---|
private HttpClientConnector.HttpAuthenticationHandler |
authenticator |
private java.util.List<HttpClientConnector.HttpAuthenticationHandler> |
availableAuthentications |
private HttpClientConnector.HttpAuthenticationHandler |
basic |
private java.util.Iterator<HttpClientConnector.HttpAuthenticationHandler> |
clientAuthentications |
private static java.lang.String |
HTTP_HEADER_PROXY_AUTHENTICATION |
private static java.lang.String |
HTTP_HEADER_PROXY_AUTHORIZATION |
private HttpClientConnector.HttpAuthenticationHandler |
negotiate |
private boolean |
ongoing |
proxyAddress, proxyPassword, proxyUser, remoteAddress
TIMEOUT_PROPERTY
Constructor and Description |
---|
HttpClientConnector(java.net.InetSocketAddress proxyAddress,
java.net.InetSocketAddress remoteAddress)
Creates a new
HttpClientConnector . |
HttpClientConnector(java.net.InetSocketAddress proxyAddress,
java.net.InetSocketAddress remoteAddress,
java.lang.String proxyUser,
char[] proxyPassword)
Creates a new
HttpClientConnector . |
Modifier and Type | Method and Description |
---|---|
private java.lang.StringBuilder |
authenticate(java.lang.StringBuilder msg,
java.lang.String token) |
private void |
close() |
private java.lang.StringBuilder |
connect() |
private java.lang.StringBuilder |
eol(java.lang.StringBuilder msg) |
private AuthenticationChallenge |
getByName(java.util.List<AuthenticationChallenge> challenges,
java.lang.String name) |
private void |
handleMessage(org.apache.sshd.common.io.IoSession session,
java.util.List<java.lang.String> reply) |
void |
messageReceived(org.apache.sshd.common.io.IoSession session,
org.apache.sshd.common.util.Readable buffer)
Handle a received message.
|
private HttpClientConnector.HttpAuthenticationHandler |
selectProtocol(java.util.List<AuthenticationChallenge> challenges,
HttpClientConnector.HttpAuthenticationHandler current) |
private void |
send(java.lang.StringBuilder msg,
org.apache.sshd.common.io.IoSession session) |
void |
sendClientProxyMetadata(org.apache.sshd.client.session.ClientSession sshSession) |
adjustTimeout, clearPassword, getTimeout, init, runWhenDone, setDone
private static final java.lang.String HTTP_HEADER_PROXY_AUTHENTICATION
private static final java.lang.String HTTP_HEADER_PROXY_AUTHORIZATION
private HttpClientConnector.HttpAuthenticationHandler basic
private HttpClientConnector.HttpAuthenticationHandler negotiate
private java.util.List<HttpClientConnector.HttpAuthenticationHandler> availableAuthentications
private java.util.Iterator<HttpClientConnector.HttpAuthenticationHandler> clientAuthentications
private HttpClientConnector.HttpAuthenticationHandler authenticator
private boolean ongoing
public HttpClientConnector(@NonNull java.net.InetSocketAddress proxyAddress, @NonNull java.net.InetSocketAddress remoteAddress)
HttpClientConnector
. The connector supports
anonymous proxy connections as well as Basic and Negotiate
authentication.proxyAddress
- of the proxy server we're connecting toremoteAddress
- of the target server to connect topublic HttpClientConnector(@NonNull java.net.InetSocketAddress proxyAddress, @NonNull java.net.InetSocketAddress remoteAddress, java.lang.String proxyUser, char[] proxyPassword)
HttpClientConnector
. The connector supports
anonymous proxy connections as well as Basic and Negotiate
authentication. If a user name and password are given, the connector
tries pre-emptive Basic authentication.proxyAddress
- of the proxy server we're connecting toremoteAddress
- of the target server to connect toproxyUser
- to authenticate at the proxy withproxyPassword
- to authenticate at the proxy withprivate void close()
public void sendClientProxyMetadata(org.apache.sshd.client.session.ClientSession sshSession) throws java.lang.Exception
java.lang.Exception
private void send(java.lang.StringBuilder msg, org.apache.sshd.common.io.IoSession session) throws java.lang.Exception
java.lang.Exception
private java.lang.StringBuilder connect()
private java.lang.StringBuilder authenticate(java.lang.StringBuilder msg, java.lang.String token)
private java.lang.StringBuilder eol(java.lang.StringBuilder msg)
public void messageReceived(org.apache.sshd.common.io.IoSession session, org.apache.sshd.common.util.Readable buffer) throws java.lang.Exception
StatefulProxyConnector
session
- to use for writing databuffer
- received datajava.lang.Exception
- if data cannot be read, or the connection attempt failsprivate void handleMessage(org.apache.sshd.common.io.IoSession session, java.util.List<java.lang.String> reply) throws java.lang.Exception
java.lang.Exception
private HttpClientConnector.HttpAuthenticationHandler selectProtocol(java.util.List<AuthenticationChallenge> challenges, HttpClientConnector.HttpAuthenticationHandler current) throws java.lang.Exception
java.lang.Exception
private AuthenticationChallenge getByName(java.util.List<AuthenticationChallenge> challenges, java.lang.String name)