Class ProxyConfig

java.lang.Object
com.linecorp.armeria.client.proxy.ProxyConfig
Direct Known Subclasses:
ConnectProxyConfig, DirectProxyConfig, HAProxyConfig, Socks4ProxyConfig, Socks5ProxyConfig

public abstract class ProxyConfig extends Object
Base configuration for proxy settings used by ClientFactory.
  • Method Details

    • socks4

      public static Socks4ProxyConfig socks4(InetSocketAddress proxyAddress)
      Creates a ProxyConfig configuration for SOCKS4 protocol.
      Parameters:
      proxyAddress - the proxy address
    • socks4

      public static Socks4ProxyConfig socks4(InetSocketAddress proxyAddress, String username)
      Creates a ProxyConfig configuration for SOCKS4 protocol.
      Parameters:
      proxyAddress - the proxy address
      username - the username
    • socks5

      public static Socks5ProxyConfig socks5(InetSocketAddress proxyAddress)
      Creates a ProxyConfig configuration for SOCKS5 protocol.
      Parameters:
      proxyAddress - the proxy address
    • socks5

      public static Socks5ProxyConfig socks5(InetSocketAddress proxyAddress, String username, String password)
      Creates a ProxyConfig configuration for SOCKS5 protocol.
      Parameters:
      proxyAddress - the proxy address
      username - the username
      password - the password
    • connect

      public static ConnectProxyConfig connect(InetSocketAddress proxyAddress)
      Creates a ProxyConfig configuration for CONNECT protocol.
      Parameters:
      proxyAddress - the proxy address
    • connect

      public static ConnectProxyConfig connect(InetSocketAddress proxyAddress, boolean useTls)
      Creates a ProxyConfig configuration for CONNECT protocol.
      Parameters:
      proxyAddress - the proxy address
      useTls - whether to use TLS to connect to the proxy
    • connect

      public static ConnectProxyConfig connect(InetSocketAddress proxyAddress, String username, String password, boolean useTls)
      Creates a ProxyConfig configuration for CONNECT protocol.
      Parameters:
      proxyAddress - the proxy address
      username - the username
      password - the password
      useTls - whether to use TLS to connect to the proxy
    • haproxy

      public static HAProxyConfig haproxy(InetSocketAddress proxyAddress, InetSocketAddress sourceAddress)
      Creates a ProxyConfig configuration for HAProxy protocol.
      Parameters:
      proxyAddress - the proxy address
      sourceAddress - the source address
    • haproxy

      public static ProxyConfig haproxy(InetSocketAddress proxyAddress)
      Creates a ProxyConfig configuration for HAProxy protocol. The sourceAddress will be inferred from either the ServiceRequestContext or the local connection address.
      Parameters:
      proxyAddress - the proxy address
    • direct

      public static ProxyConfig direct()
      Returns a ProxyConfig which signifies that a proxy is absent.
    • proxyType

      public abstract ProxyType proxyType()
      Returns the proxy type.
    • proxyAddress

      @Nullable public abstract @Nullable InetSocketAddress proxyAddress()
      Returns the proxy address which is null only for ProxyType.DIRECT.