Class DefaultProxyDataFactory

java.lang.Object
org.apache.sshd.client.proxy.DefaultProxyDataFactory
All Implemented Interfaces:
ProxyDataFactory

public class DefaultProxyDataFactory extends Object implements 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 Details

  • Method Details

    • get

      public ProxyData get(InetSocketAddress remoteAddress)
      Description copied from interface: ProxyDataFactory
      Get the ProxyData to connect to a proxy. It should return a new ProxyData instance every time. The caller is responsible for clearing the password, if any, once it is no longer needed.
      Specified by:
      get in interface ProxyDataFactory
      Parameters:
      remoteAddress - to connect to
      Returns:
      the ProxyData or null if a direct connection is to be made