public final class HttpProxy extends HttpCredential
Example - Explicitly declare that requests to localhost or www.camptocamp.org require proxying:
proxies:
- !proxy
requireProxy:
- !localMatch {}
- !ipMatch
ip: www.camptocamp.org
host: proxy.host.com
port: 8888
username: username
password: xyzpassword
Example - Proxy all requests except localhost and www.camptocamp.org:
proxies:
- !proxy
noProxy:
- !localMatch {}
- !ipMatch
ip: www.camptocamp.org
scheme: http
host: proxy.host.com
port: 8888
username: username
password: xyzpassword
| Constructor and Description |
|---|
HttpProxy() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.HttpHost |
getHttpHost() |
void |
setHost(java.lang.String host)
The host of the proxy.
|
void |
setMatchers(java.util.List<? extends URIMatcher> matchers)
Matchers are used to choose which requests this proxy applies to.
|
void |
setPassword(java.lang.String password)
The password for authenticating with the proxy.
|
void |
setPort(int port)
The host of the proxy.
|
void |
setScheme(java.lang.String scheme)
The scheme (http, https) of the proxy.
|
void |
setUsername(java.lang.String username)
The username for authenticating with the proxy.
|
void |
validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
validate that the configuration was correct.
|
getMatchers, getUsername, matches, toCredentialspublic org.apache.http.HttpHost getHttpHost()
public void setMatchers(java.util.List<? extends URIMatcher> matchers)
setMatchers in class HttpCredentialmatchers - the matchers to use to determine which requests the applies can be used forURIMatcher,
RestrictUrisProcessorpublic void setHost(java.lang.String host)
This is required.
host - the host of the proxypublic void setScheme(java.lang.String scheme)
This is optional, default is http if no username and https if there is a password
scheme - the scheme of the proxypublic void setUsername(java.lang.String username)
This is optional
setUsername in class HttpCredentialusername - the username for authenticating with the proxypublic void setPassword(java.lang.String password)
This is optional
setPassword in class HttpCredentialpassword - the password for authenticating with the proxypublic void setPort(int port)
This is optional. The default value is 80.
port - the port of the proxypublic void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
ConfigurationObjectvalidate in interface ConfigurationObjectvalidate in class HttpCredentialvalidationErrors - a list to add any detected errors to.configuration - the containing configuration