Class Socks5Proxy
Client-side proxy configuration for SOCKS5, defined by RFC 1928.
Multiple authentication methods are supported via
putAuthenticationFactory(Socks5.Authentication.Factory)
.
By default only the NO AUTH
authentication method is configured.
The USERNAME/PASSWORD
is available to applications but must be explicitly configured and
added.
-
Constructor Summary
ConstructorDescriptionSocks5Proxy
(String host, int port) Creates a new instance with the given SOCKS5 proxy host and port.Socks5Proxy
(Origin.Address address, boolean secure) Creates a new instance with the given SOCKS5 proxy address. -
Method Summary
Modifier and TypeMethodDescriptionnewClientConnectionFactory
(ClientConnectionFactory connectionFactory) putAuthenticationFactory
(Socks5.Authentication.Factory authenticationFactory) Provides this class with the given SOCKS5 authentication method.removeAuthenticationFactory
(byte method) Removes the authentication of the givenmethod
.Methods inherited from class org.eclipse.jetty.client.ProxyConfiguration.Proxy
getAddress, getExcludedAddresses, getIncludedAddresses, getOrigin, getProtocol, getSslContextFactory, getURI, isSecure, matches, toString
-
Constructor Details
-
Socks5Proxy
Creates a new instance with the given SOCKS5 proxy host and port.
- Parameters:
host
- the SOCKS5 proxy host nameport
- the SOCKS5 proxy port
-
Socks5Proxy
Creates a new instance with the given SOCKS5 proxy address.
When
secure=true
the communication between the client and the proxy will be encrypted (using this proxyProxyConfiguration.Proxy.getSslContextFactory()
which typically defaults to that ofHttpClient
.- Parameters:
address
- the SOCKS5 proxy address (host and port)secure
- whether the communication between the client and the SOCKS5 proxy should be secure
-
-
Method Details
-
putAuthenticationFactory
public Socks5.Authentication.Factory putAuthenticationFactory(Socks5.Authentication.Factory authenticationFactory) Provides this class with the given SOCKS5 authentication method.
- Parameters:
authenticationFactory
- the SOCKS5 authentication factory- Returns:
- the previous authentication method of the same type, or
null
if there was none of that type already present
-
removeAuthenticationFactory
Removes the authentication of the given
method
.- Parameters:
method
- the authentication method to remove
-
newClientConnectionFactory
public ClientConnectionFactory newClientConnectionFactory(ClientConnectionFactory connectionFactory) - Specified by:
newClientConnectionFactory
in classProxyConfiguration.Proxy
- Parameters:
connectionFactory
- the nestedClientConnectionFactory
- Returns:
- a new
ClientConnectionFactory
for this Proxy
-