All Classes and Interfaces
Class
Description
Outbound handler that adds an
Alt-Svc header to responses served
over the TCP (HTTP/1.1 and HTTP/2) paths when HTTP/3 is enabled.Sizes the buffer each read of an accepted connection is given: as the channel's own allocator does (adaptive,
following recent reads down to 64 bytes) until the connection is found to be binary, then
BinaryAwareRecvByteBufAllocator.BINARY_READ_SIZE for every read, so that a binary message is not cut by a buffer that has followed
small messages down.Cuts a binary connection into the messages of a protocol, as a client sends them, so that each is matched,
forwarded and logged as one message however it was read.
Joins what one read loop delivers on a binary connection into one message, so that a message is not cut where a
read buffer filled or where TLS handed over part of what it had decrypted.
One binary client connection's single upstream connection, and the bytes relayed between the two as they arrive.
Logs a client's failed TLS handshake, on TCP and on HTTP/3: at
WARN for the first failure from a client
address on a transport, with a hint about its likely cause, and at DEBUG for each later one, so a client
that retries, or a scan, does not fill the log.A composite
TransparentProxyHandler.OriginalDestinationResolver that tries
an ordered chain of resolution strategies and returns the first non-null result.Copies the connection-scoped channel attributes from a parent channel onto a child channel.
Resolves the original destination of a transparently intercepted TCP connection
by reading the Linux conntrack table (
/proc/net/nf_conntrack).The checks every control-plane WebSocket upgrade (
/_mockserver_ui_websocket and
/_mockserver_callback_websocket) must pass before it is upgraded: the browser
Origin must be allowed by CORSOriginPolicy, and the control-plane
authentication, when configured, must allow the request.The caller of an admitted upgrade: whether control-plane authentication admitted it and, when
its authentication handler can name one, the caller's identity.
Shortens the bodies the dashboard sends in its live updates.
Renders one log entry's bodies for the dashboard: a body already cut for an earlier row under the same
variant (with redaction on, its redacted rendering) comes back as that cut text without being decoded again.
What capping one log entry's messages found: each cut copy's full body length, and roughly how many
characters the entry adds to an update.
Builds the Netty writers used when an extension request filter or response transformer is loaded.
Resolves the original destination of a transparently intercepted TCP connection
by consulting the
DnsIntentRegistry โ a record of hostname-to-IP answers
that MockServer's DNS server has handed out.Thrown at start-up when
dnsEnabled is true and the DNS server could not be started on dnsPort,
so that MockServer does not run without a listener it was configured to serve.Inspects the incoming Netty HttpRequest (headers only) and, when a matching expectation
is configured with
respondBeforeBody=true, dispatches the response and closes the
connection before HttpObjectAggregator buffers the request body.Response writer for the early-dispatch path.
Resolves the original destination of a transparently intercepted TCP connection
by reading a pinned BPF hash map populated by an external eBPF program.
The proxy client's side of the CONNECT/SOCKS relay's HTTP/2 tunnel, handing each request on once, with its whole body.
Leaves Netty's
x-http2- extension headers (HttpConversionUtil.ExtensionHeaderNames) out of every
header block an HttpToHttp2ConnectionHandler sends.Per-stream handler for serving gRPC Server Reflection interactively over the
bidirectional-streaming multiplex pipeline.
Per-stream router that inspects the first
Http2HeadersFrame to determine whether
this stream is a true bidirectional-streaming gRPC method.Per-stream handler for true bidirectional gRPC streaming.
Adapter that bridges gRPC request/response framing for the HTTP/3 path.
Holds the parts of a gRPC response for HTTP/3 framing:
the gRPC-framed body bytes, the grpc-status value, and
an optional grpc-message.
Converts a matched (JSON-bodied)
HttpResponse back into a gRPC wire response:
a length-prefixed protobuf frame plus a grpc-status trailer.Readiness probe:
PUT /mockserver/status on localhost, exit 0 only on HTTP 200.What MockServer logs when an HTTP/1.1 connection closes, by its client's close or reset or otherwise, while a
request's body is still arriving: one
INFO entry with the request's method, path, query string and headers
where the aggregator still holds them, and no stack trace, as an HTTP/2 stream that ends with its connection is
logged by Http2StreamFaults.The last handler of a direct HTTP/2 connection's pipeline.
Emits an HTTP/2
GOAWAY frame on the connection carrying ctx so the client is told
to stop opening new streams and drain โ the graceful "this connection is going away" signal a
server sends before a shutdown / preemption.Per-stream child initializer used with
Http2MultiplexHandler
to build the pipeline for every HTTP/2 stream.Limits the header list of an HTTP/2 request to
maxHeaderSize, as HTTP/1.1 limits its header section, and
logs each request refused for it.What MockServer logs when an HTTP/2 stream ends before it should, on a connection made straight to MockServer and
on the client leg of a CONNECT or SOCKS tunnel alike, each once and with no stack trace:
INFO for a request its client cancelled, or whose connection closed, before it was complete;
WARN for an error of the stream's own, which Netty then resets the stream for with the error's code;
WARN for a connection Netty closes because it had to be sent too many of those resets.
See "HTTP/2 streams cut short" in docs/code/netty-pipeline.md for what bounds the entries of one connection.Times one HTTP/2 stream for
mock_server_request_transport_duration_seconds: from its first
HEADERS frame reaching the stream's channel to the write of the frame that ends the response stream
completing.Resets an HTTP/2 stream whose response has data waiting in the connection's flow controller that the client has
taken none of for
responseWriteStallTimeoutMillis.HTTP/3 CONNECT-UDP (MASQUE, RFC 9298) relay handler.
The last handler of an HTTP/3 connection's pipeline.
Drives true bidirectional gRPC streaming over a single QUIC bidirectional stream
(HTTP/3).
A
ResponseWriter that writes gRPC responses over HTTP/3 with correct
gRPC wire framing: initial HEADERS (:status=200,
content-type=application/grpc), DATA (gRPC length-prefixed message),
and trailing HEADERS (grpc-status, grpc-message, plus any trailing metadata the
expectation authored with withTrailer(...)).The last handler of the HTTP/3 UDP listener's pipeline, behind the QUIC codec, which takes no exception itself.
HTTP/3 request stream handler that bridges incoming QUIC requests into
MockServer's standard request-processing pipeline (expectation matching,
actions, recording, proxy forwarding).
Thrown at start-up when
http3Port is set but the QUIC native library cannot be loaded.Converts between HTTP/3 frames and MockServer's
HttpRequest/HttpResponse model.Parsed HTTP/3 pseudo-headers and regular headers.
A
ResponseWriter that serialises the MockServer HttpResponse
as HTTP/3 frames and writes them to a QUIC stream channel.The HTTP/3 listener's segmented (GSO,
UDP_SEGMENT) sends, given to the QUIC codec as its allocator and
placed in the listener's pipeline to watch the sends it makes.HTTP/3 (QUIC) server for MockServer, integrated with the full request pipeline.
Thrown at start-up when
http3Port is set and the HTTP/3 server could not be started on it, so that
MockServer does not run without a protocol it was configured to serve.Resets an HTTP/3 request stream (
RESET_STREAM H3_INTERNAL_ERROR) when writes have been waiting on it for
responseWriteStallTimeoutMillis and QUIC has taken none of them, so a client that stops reading a response
cannot hold it, or a streamed response's upstream, indefinitely.Counts HTTP/1.1 exchanges in progress on a connection for
InboundConnectionIdleHandler: an
exchange starts when a request head is decoded and ends when the last part of its response has been
written to the socket, so a delayed, paused or streaming response keeps the connection busy.Keeps
HttpServerCodec pairing each response with the request it answers when an exchange ends without its
response passing the codec's encoder.The
HttpServerCodec of an HTTP/1.1 connection a client opens, directly or through a CONNECT/SOCKS tunnel.Times each HTTP/1.1 exchange on a connection for
mock_server_request_transport_duration_seconds:
from the request head being decoded to the write of the last part of its response completing on the
socket.What an inbound connection is doing, so
InboundConnectionIdleHandler closes only connections
that are genuinely quiet.Closes an inbound connection that has read and written nothing for
inboundConnectionIdleTimeoutMillis
and has nothing in progress (see InboundConnectionActivity.isBusy(io.netty.channel.Channel)).Counts the inbound connections a MockServer holds open and, when
maxInboundConnections is
set, refuses any connection accepted beyond it.Per-request in-flight token used by the WS7.2 graceful-shutdown connection drain.
The UDP counterpart of the TCP listeners'
LoopbackShadowProbe, for the HTTP/3 and DNS listeners.Cuts a binary connection into messages that each carry their own length:
offset bytes, then an unsigned
length field of prefixBytes (1, 2, 4 or 8) in the byte order given, then the body.A
Http2StreamFrameToHttpObjectCodec that is lenient on the INBOUND (request) side but
strict on the OUTBOUND (response) side.Answers the proxy client with a
502 when the CONNECT/SOCKS relay's HTTP/1.1 loopback fails to decode a
response (a corrupt compressed body, one larger than maxRequestBodySize, or one the codec marks as failed)
before its head has been relayed.Ends the proxy client's HTTP/2 streams at once when the CONNECT/SOCKS relay's HTTP/2 loopback connection closes, for
any reason, instead of leaving them to Netty's 30 s graceful-shutdown timeout.
Answers the proxy client's HTTP/2 stream when the CONNECT/SOCKS relay's HTTP/2 loopback stream for it ends without
a response: the response failed to decode, passed
maxRequestBodySize, or MockServer reset the stream.Gives each request the CONNECT/SOCKS relay writes to its HTTP/2 loopback a loopback stream id of its own, and puts
the proxy client's stream id back on the response.
On MockServer's side of an HTTP/1.1 relay loopback, after its codec: tells the tunnel's relay what the bytes on the
loopback cannot.
Carries a deliberate reset (an
HttpError resetConnection, or a chaos resetPeer or
resetMidResponse) of a CONNECT/SOCKS tunnel's loopback through to the tunnel's client connection, which the
relay would otherwise end with a clean close (or, on h2, a GOAWAY and stream resets).Deterministic conformance / contract tester for a target MCP (Model Context Protocol)
server reachable over Streamable HTTP.
Outcome of a single named conformance check.
Result of a single JSON-RPC exchange.
One JSON-RPC exchange against the target server.
Full conformance report.
Registry of MCP prompts exposed by MockServer's own MCP server.
Thrown by
McpPromptRegistry.getMessages(java.lang.String, com.fasterxml.jackson.databind.JsonNode) when a prompts/get call omits a required argument, which
the MCP prompts specification answers with JSON-RPC error -32602 (invalid params).Transport-neutral MCP (Model Context Protocol) JSON-RPC request processor.
Result of processing an MCP request.
Netty channel handler that intercepts MCP (Model Context Protocol) requests
on the TCP (HTTP/1.1 and HTTP/2) path.
Wires the
IP_TRANSPARENT socket option on the server bootstrap when
TPROXY mode is enabled.Cuts a binary connection into the messages of the MySQL client/server protocol, as a client sends them.
Serves the embedded OpenAPI specification at GET /mockserver/openapi.yaml
Sends a large encoded HTTP/1.1 message to the socket in slices, writing the next slice only while the
connection is writable.
Cuts a binary connection into the messages of the PostgreSQL frontend/backend protocol (version 3), as a client
sends them.
Inbound handler that detects and parses PROXY protocol v1 (text format) and v2 (binary
format) headers prepended to TCP connections by upstream load balancers (e.g., AWS GWLB,
HAProxy, nginx with
proxy_protocol on).A received request that has no method or path, such as a DNS query or a binary message, sent as its kind and a
summary for the dashboard to lay out as it lays out an HTTP request's method and path.
Cuts a binary connection into the messages of the Redis serialization protocol (RESP2 and RESP3), as a client sends
them: one complete top-level value with everything nested in it, or, when the first byte names no RESP type, one
inline command up to and including its line feed.
The local addresses of the loopback connections
RelayConnectHandler opens to MockServer, each with the proxy
client's channel of its tunnel, so the accepting side can tell its own relay's loopback leg from a client that merely
sends the same PROXIED_ preamble, and can reach the tunnel's other leg.This class is expected to be used from within a
ReplayingDecoder, or with enough bytes available.Reads the original destination of an intercepted TCP connection on Linux.
Resolves the original destination of a transparently intercepted TCP connection
by calling
getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, ...) via JNA on Linux.Source-address-validating QUIC retry token handler (stateless retry, RFC 9000 ยง8.1).
Translates a
StreamAddressedHttpContent into the child-channel equivalent when a streaming
response is written on an Http2MultiplexHandler child channel.Netty
ChannelDuplexHandler that injects raw TCP-layer faults
before HTTP decoding, based on the TcpChaosProfile
registered in TcpChaosRegistry for the connection's remote host.Resolves the original destination of a transparently intercepted TCP connection
using the TPROXY (IP_TRANSPARENT) mechanism.
Netty handler that extracts W3C
traceparent / tracestate
headers from inbound HttpRequest objects and stores the parsed
W3CTraceContext as a channel attribute, replacing (or clearing) any
context from an earlier request on the same connection.The gRPC-over-HTTP/3 writer built when an extension request filter or response transformer is loaded: an
Http3GrpcResponseWriter whose data-plane writes follow TransformingWrites, so the response
transformers see the JSON response before it is framed as protobuf.The HTTP/3 writer built when an extension request filter or response transformer is loaded: an
Http3ResponseWriter whose data-plane writes follow TransformingWrites.The HTTP/1.1 and HTTP/2 writer
DataPlaneWriters builds when an extension request filter or response
transformer is loaded: a NettyResponseWriter whose data-plane writes follow TransformingWrites.A Netty channel handler that resolves the original destination for transparently
intercepted connections and stores it as the
HttpActionHandler.REMOTE_SOCKET
channel attribute.Strategy interface for resolving the original destination.
Utility for transparent HTTP proxy mode โ provides Host-header parsing helpers
and an
TransparentProxyInitializer.isEnabled() configuration check.What a relay does with the upstream's reply to one message it forwards: relays it to the client (the default),
drops it, or drops it and writes other bytes to the client in its place once it has ended.
Closes an inbound connection when bytes have been waiting for its client for
responseWriteStallTimeoutMillis
and the client has taken none of them, so a client that stops reading cannot hold what is queued for it (and, for a
streamed response, its upstream connection) indefinitely.