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"
Resolve the original destination of intercepted connections using the Linux TPROXY mechanism instead of REDIRECT. When enabled, the original destination is read from the socket's local address (preserved by the TPROXY iptables target), allowing MockServer to forward to the real destination address rather than relying on the Host header.
Requires Linux, the epoll transport, the CAP_NET_ADMIN capability, and TPROXY iptables rules instead of REDIRECT.
Type: boolean Default: false
Java Code:
ConfigurationProperties.transparentProxyTproxy(boolean enable)
System Property:
-Dmockserver.transparentProxyTproxy=...
Environment Variable:
MOCKSERVER_TRANSPARENT_PROXY_TPROXY=...
Property File:
mockserver.transparentProxyTproxy=...
Example:
-Dmockserver.transparentProxyTproxy="true"
Resolve the original destination of intercepted connections by reading from a pinned eBPF (BPF) hash map, populated by an external cgroup/connect4 BPF program and keyed by socket cookie. This is an alternative to TPROXY for recovering the real destination address.
Requires Linux, the CAP_BPF capability, a BTF-enabled kernel, and the external BPF program that populates the map (see transparentProxyEbpfMapPath).
Type: boolean Default: false
Java Code:
ConfigurationProperties.transparentProxyEbpf(boolean enable)
System Property:
-Dmockserver.transparentProxyEbpf=...
Environment Variable:
MOCKSERVER_TRANSPARENT_PROXY_EBPF=...
Property File:
mockserver.transparentProxyEbpf=...
Example:
-Dmockserver.transparentProxyEbpf="true"
Path to the pinned BPF map used by the eBPF original destination resolver. The map must be a BPF hash map with a u64 key (socket cookie) and a 6-byte value (4-byte IPv4 address + 2-byte port in network byte order).
Only used when transparentProxyEbpf is enabled.
Type: string Default: /sys/fs/bpf/mockserver_orig_dst
Java Code:
ConfigurationProperties.transparentProxyEbpfMapPath(String path)
System Property:
-Dmockserver.transparentProxyEbpfMapPath=...
Environment Variable:
MOCKSERVER_TRANSPARENT_PROXY_EBPF_MAP_PATH=...
Property File:
mockserver.transparentProxyEbpfMapPath=...
Example:
-Dmockserver.transparentProxyEbpfMapPath="/sys/fs/bpf/mockserver_orig_dst"