Interface ProxyConfigProvider
- All Known Implementing Classes:
ProxyEnvironmentVariableConfigProvider,ProxySystemPropertyConfigProvider
Interface for providing proxy configuration settings. Implementations of this interface can retrieve proxy configuration
from various sources such as system properties and environment variables.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ProxyConfigProviderfromEnvironmentSettings(String scheme) Returns a newProxyConfigProviderthat retrieves proxy configuration from environment variables.static ProxyConfigProviderfromSystemEnvironmentSettings(Boolean useSystemPropertyValues, Boolean useEnvironmentVariableValues, String scheme) Returns aProxyConfigProviderbased on the specified settings for using system properties, environment variables, and the scheme.static ProxyConfigProviderfromSystemPropertySettings(String scheme) Returns a newProxyConfigProviderthat retrieves proxy configuration from system properties.host()Gets the proxy host.Gets the set of non-proxy hosts.password()Gets the proxy password if available.intport()Gets the proxy port.Gets the set of non-proxy hosts as raw tokens, i.e.userName()Gets the proxy username if available.
-
Field Details
-
HTTPS
-
-
Method Details
-
fromSystemPropertySettings
Returns a newProxyConfigProviderthat retrieves proxy configuration from system properties.- Parameters:
scheme- The URI scheme for which the proxy configuration is needed (e.g., "http" or "https").- Returns:
- A
ProxyConfigProviderfor system property-based proxy configuration.
-
fromEnvironmentSettings
Returns a newProxyConfigProviderthat retrieves proxy configuration from environment variables.- Parameters:
scheme- The URI scheme for which the proxy configuration is needed (e.g., "http" or "https").- Returns:
- A
ProxyConfigProviderfor environment variable-based proxy configuration.
-
fromSystemEnvironmentSettings
static ProxyConfigProvider fromSystemEnvironmentSettings(Boolean useSystemPropertyValues, Boolean useEnvironmentVariableValues, String scheme) Returns aProxyConfigProviderbased on the specified settings for using system properties, environment variables, and the scheme.- Parameters:
useSystemPropertyValues- ABooleanindicating whether to use system property values.useEnvironmentVariableValues- ABooleanindicating whether to use environment variable values.scheme- The URI scheme for which the proxy configuration is needed (e.g., "http" or "https").- Returns:
- A
ProxyConfigProviderbased on the specified settings.
-
port
int port()Gets the proxy port.- Returns:
- The proxy port.
-
userName
-
password
-
host
-
nonProxyHosts
-
rawNonProxyHosts
Gets the set of non-proxy hosts as raw tokens, i.e. without the* -> .*?Java-regex rewrite thatnonProxyHosts()applies for system-property and environment-variable sources. Consumers whose matcher expects the rawnonProxyHoststokens (such as the CRT client's curl-style native matcher) must use this instead ofnonProxyHosts().The default throws
UnsupportedOperationExceptionrather than falling back tononProxyHosts(): a fallback would silently feed Java-regex tokens into a curl-style matcher and reintroduce incorrect proxy bypass. Implementations consumed by CRT-based clients must override it.- Returns:
- A set containing the raw non-proxy host tokens.
-