Class EnvProxySearchStrategy
java.lang.Object
com.github.markusbernhardt.proxy.search.env.EnvProxySearchStrategy
- All Implemented Interfaces:
ProxySearchStrategy
Reads some environment variables and extracts the proxy settings from them.
These variables are mainly set on linux / unix environments. The following
variables are read per default:
- http_proxy -> This will be used for http / https
- https_proxy -> Will be used for https, if not set then http_proxy is used instead.
- ftp_proxy -> Used for FTP.
- no_proxy -> a no proxy white list.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor Will use the default environment variables.EnvProxySearchStrategy(String httpEnv, String httpsEnv, String ftpEnv, String noProxyEnv) Constructor -
Method Summary
Modifier and TypeMethodDescriptiongetName()Gets the printable name of the search strategy.Loads the proxy settings from environment variables.private voidLoads the proxy settings from the system environment variables.Loads the settings and stores them in a properties map.
-
Field Details
-
httpEnv
-
httpsEnv
-
ftpEnv
-
noProxyEnv
-
httpProxy
-
httpsProxy
-
ftpProxy
-
noProxy
-
-
Constructor Details
-
EnvProxySearchStrategy
public EnvProxySearchStrategy()Constructor Will use the default environment variables. -
EnvProxySearchStrategy
-
-
Method Details
-
loadProxySettings
private void loadProxySettings()Loads the proxy settings from the system environment variables. -
readSettings
Loads the settings and stores them in a properties map.- Returns:
- the settings.
-
getProxySelector
Loads the proxy settings from environment variables.- Specified by:
getProxySelectorin interfaceProxySearchStrategy- Returns:
- a configured ProxySelector, null if none is found.
-
getName
Gets the printable name of the search strategy.- Specified by:
getNamein interfaceProxySearchStrategy- Returns:
- the printable name of the search strategy
-