Class ProxyConfig
java.lang.Object
com.linecorp.armeria.client.proxy.ProxyConfig
- Direct Known Subclasses:
ConnectProxyConfig
,DirectProxyConfig
,HAProxyConfig
,Socks4ProxyConfig
,Socks5ProxyConfig
Base configuration for proxy settings used by
ClientFactory
.-
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectProxyConfig
connect(InetSocketAddress proxyAddress)
Creates aProxyConfig
configuration for CONNECT protocol.static ConnectProxyConfig
connect(InetSocketAddress proxyAddress, boolean useTls)
Creates aProxyConfig
configuration for CONNECT protocol.static ConnectProxyConfig
connect(InetSocketAddress proxyAddress, String username, String password, boolean useTls)
Creates aProxyConfig
configuration for CONNECT protocol.static ProxyConfig
direct()
Returns aProxyConfig
which signifies that a proxy is absent.static ProxyConfig
haproxy(InetSocketAddress proxyAddress)
Creates aProxyConfig
configuration for HAProxy protocol.static HAProxyConfig
haproxy(InetSocketAddress proxyAddress, InetSocketAddress sourceAddress)
Creates aProxyConfig
configuration for HAProxy protocol.abstract @Nullable InetSocketAddress
Returns the proxy address which isnull
only forProxyType.DIRECT
.abstract ProxyType
Returns the proxy type.static Socks4ProxyConfig
socks4(InetSocketAddress proxyAddress)
Creates aProxyConfig
configuration for SOCKS4 protocol.static Socks4ProxyConfig
socks4(InetSocketAddress proxyAddress, String username)
Creates aProxyConfig
configuration for SOCKS4 protocol.static Socks5ProxyConfig
socks5(InetSocketAddress proxyAddress)
Creates aProxyConfig
configuration for SOCKS5 protocol.static Socks5ProxyConfig
socks5(InetSocketAddress proxyAddress, String username, String password)
Creates aProxyConfig
configuration for SOCKS5 protocol.
-
Method Details
-
socks4
Creates aProxyConfig
configuration for SOCKS4 protocol.- Parameters:
proxyAddress
- the proxy address
-
socks4
Creates aProxyConfig
configuration for SOCKS4 protocol.- Parameters:
proxyAddress
- the proxy addressusername
- the username
-
socks5
Creates aProxyConfig
configuration for SOCKS5 protocol.- Parameters:
proxyAddress
- the proxy address
-
socks5
public static Socks5ProxyConfig socks5(InetSocketAddress proxyAddress, String username, String password)Creates aProxyConfig
configuration for SOCKS5 protocol.- Parameters:
proxyAddress
- the proxy addressusername
- the usernamepassword
- the password
-
connect
Creates aProxyConfig
configuration for CONNECT protocol.- Parameters:
proxyAddress
- the proxy address
-
connect
Creates aProxyConfig
configuration for CONNECT protocol.- Parameters:
proxyAddress
- the proxy addressuseTls
- whether to use TLS to connect to the proxy
-
connect
public static ConnectProxyConfig connect(InetSocketAddress proxyAddress, String username, String password, boolean useTls)Creates aProxyConfig
configuration for CONNECT protocol.- Parameters:
proxyAddress
- the proxy addressusername
- the usernamepassword
- the passworduseTls
- whether to use TLS to connect to the proxy
-
haproxy
public static HAProxyConfig haproxy(InetSocketAddress proxyAddress, InetSocketAddress sourceAddress)Creates aProxyConfig
configuration for HAProxy protocol.- Parameters:
proxyAddress
- the proxy addresssourceAddress
- the source address
-
haproxy
Creates aProxyConfig
configuration for HAProxy protocol. ThesourceAddress
will be inferred from either theServiceRequestContext
or the local connection address.- Parameters:
proxyAddress
- the proxy address
-
direct
Returns aProxyConfig
which signifies that a proxy is absent. -
proxyType
Returns the proxy type. -
proxyAddress
Returns the proxy address which isnull
only forProxyType.DIRECT
.
-