Class DefaultProxyDataFactory
java.lang.Object
org.apache.sshd.client.proxy.DefaultProxyDataFactory
- All Implemented Interfaces:
ProxyDataFactory
A default implementation of a
ProxyDataFactory based on the standard ProxySelector. Prefers
SOCKS proxies over HTTP proxies. If the ProxySelector returns multiple proxies of the same type, the first
one is chosen.-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance that usesProxySelector.getDefault().DefaultProxyDataFactory(ProxySelector selector) Creates an instance that uses the givenProxySelector. -
Method Summary
Modifier and TypeMethodDescriptionget(InetSocketAddress remoteAddress) Get theProxyDatato connect to a proxy.
-
Constructor Details
-
DefaultProxyDataFactory
public DefaultProxyDataFactory()Creates an instance that usesProxySelector.getDefault(). -
DefaultProxyDataFactory
Creates an instance that uses the givenProxySelector.- Parameters:
selector-ProxySelectorto use; ifnull, noProxyDatawill ever be returned.
-
-
Method Details
-
get
Description copied from interface:ProxyDataFactoryGet theProxyDatato connect to a proxy. It should return a newProxyDatainstance every time. The caller is responsible for clearing the password, if any, once it is no longer needed.- Specified by:
getin interfaceProxyDataFactory- Parameters:
remoteAddress- to connect to- Returns:
- the
ProxyDataornullif a direct connection is to be made
-