Class HttpClientConnector
java.lang.Object
org.eclipse.jgit.internal.transport.sshd.proxy.AbstractClientProxyConnector
org.eclipse.jgit.internal.transport.sshd.proxy.HttpClientConnector
- All Implemented Interfaces:
org.apache.sshd.client.session.ClientProxyConnector
,StatefulProxyConnector
Simple HTTP proxy connector using Basic Authentication.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interface
private class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private boolean
Fields inherited from class org.eclipse.jgit.internal.transport.sshd.proxy.AbstractClientProxyConnector
proxyAddress, proxyPassword, proxyUser, remoteAddress
Fields inherited from interface org.eclipse.jgit.internal.transport.sshd.proxy.StatefulProxyConnector
TIMEOUT_PROPERTY
-
Constructor Summary
ConstructorsConstructorDescriptionHttpClientConnector
(InetSocketAddress proxyAddress, InetSocketAddress remoteAddress) Creates a newHttpClientConnector
.HttpClientConnector
(InetSocketAddress proxyAddress, InetSocketAddress remoteAddress, String proxyUser, char[] proxyPassword) Creates a newHttpClientConnector
. -
Method Summary
Modifier and TypeMethodDescriptionprivate StringBuilder
authenticate
(StringBuilder msg, String token) private void
close()
private StringBuilder
connect()
private StringBuilder
eol
(StringBuilder msg) private AuthenticationChallenge
getByName
(List<AuthenticationChallenge> challenges, String name) private void
handleMessage
(org.apache.sshd.common.io.IoSession session, List<String> reply) void
messageReceived
(org.apache.sshd.common.io.IoSession session, org.apache.sshd.common.util.Readable buffer) Handle a received message.selectProtocol
(List<AuthenticationChallenge> challenges, HttpClientConnector.HttpAuthenticationHandler current) private void
send
(StringBuilder msg, org.apache.sshd.common.io.IoSession session) void
sendClientProxyMetadata
(org.apache.sshd.client.session.ClientSession sshSession) Methods inherited from class org.eclipse.jgit.internal.transport.sshd.proxy.AbstractClientProxyConnector
adjustTimeout, clearPassword, getTimeout, init, runWhenDone, setDone
-
Field Details
-
HTTP_HEADER_PROXY_AUTHENTICATION
- See Also:
-
HTTP_HEADER_PROXY_AUTHORIZATION
- See Also:
-
basic
-
negotiate
-
availableAuthentications
-
clientAuthentications
-
authenticator
-
ongoing
private boolean ongoing
-
-
Constructor Details
-
HttpClientConnector
public HttpClientConnector(@NonNull InetSocketAddress proxyAddress, @NonNull InetSocketAddress remoteAddress) Creates a newHttpClientConnector
. The connector supports anonymous proxy connections as well as Basic and Negotiate authentication.- Parameters:
proxyAddress
- of the proxy server we're connecting toremoteAddress
- of the target server to connect to
-
HttpClientConnector
public HttpClientConnector(@NonNull InetSocketAddress proxyAddress, @NonNull InetSocketAddress remoteAddress, String proxyUser, char[] proxyPassword) Creates a newHttpClientConnector
. 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.- Parameters:
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 with
-
-
Method Details
-
close
private void close() -
sendClientProxyMetadata
public void sendClientProxyMetadata(org.apache.sshd.client.session.ClientSession sshSession) throws Exception - Throws:
Exception
-
send
- Throws:
Exception
-
connect
-
authenticate
-
eol
-
messageReceived
public void messageReceived(org.apache.sshd.common.io.IoSession session, org.apache.sshd.common.util.Readable buffer) throws Exception Description copied from interface:StatefulProxyConnector
Handle a received message.- Parameters:
session
- to use for writing databuffer
- received data- Throws:
Exception
- if data cannot be read, or the connection attempt fails
-
handleMessage
private void handleMessage(org.apache.sshd.common.io.IoSession session, List<String> reply) throws Exception - Throws:
Exception
-
selectProtocol
private HttpClientConnector.HttpAuthenticationHandler selectProtocol(List<AuthenticationChallenge> challenges, HttpClientConnector.HttpAuthenticationHandler current) throws Exception - Throws:
Exception
-
getByName
-