Service Mesh / Sidecar Configuration:

These properties configure MockServer for running as a Kubernetes sidecar with transparent proxy interception. See Transparent Proxy / Sidecar Mode for a full usage guide.

Enable transparent HTTP proxy mode where all connections are treated as proxy requests using the Host header as the forwarding target. This enables iptables REDIRECT-based interception without requiring clients to send explicit HTTP CONNECT requests or configure proxy settings.

When enabled, MockServer reads the Host header from each incoming request to determine the forwarding target. If an expectation matches, MockServer returns the mock response; otherwise it forwards to the original target.

Type: boolean Default: false

Java Code:

ConfigurationProperties.transparentProxyEnabled(boolean enable)

System Property:

-Dmockserver.transparentProxyEnabled=...

Environment Variable:

MOCKSERVER_TRANSPARENT_PROXY_ENABLED=...

Property File:

mockserver.transparentProxyEnabled=...

Example:

-Dmockserver.transparentProxyEnabled="true"