Configure a Proxy

Configure proxy servers for webmate tests when the application under test requires controlled network routing.

Multiple types of proxy servers are supported in webmate, such as unauthenticated proxies and authenticated proxies via username/password or NTLM authentication.

Credentials

You can also use webmate as a proxy. The following credentials, the proxy host and port are always required. The user and password are only required for username/password authentication with the proxy and user domain and password are required for NTLM authentication.

Basic setup

To use a proxy, you have to use a HttpClientBuilder and specify the host and port. If the proxy does not need authentication, this is all you need to do.

All code:

Authenticated proxy

To use a proxy with authentication you also have to provide a CredentialsProvider and set it as provider for the builder

Username + password authentication proxy

To use a proxy with username/password authentication you have to provide the credentials.

All code:

NTLM authentication proxy

To use a proxy with NTLM authentication, you have to provide the credentials, which is more complex than password authentication.

All code: