unstale

npm / mockserver-client

mockserver-client

What changed in mockserver-client 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.

75 breaking5 security2 deprecations38 new APIs and options6 performance24 behavior and defaults1 tooling32 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

mockserver-client 9183 changes

Breaking changes 75

  • Forwarded and proxied requests now carry the client's Accept-Encoding filtered to supported decompression formats; the Java client no longer adds gzip,deflate by default.

    9.0.0release notes

  • Bodies without Content-Type that are not valid UTF-8 are now preserved as exact binary bytes; callbacks, templates, WASM, logs, and HAR expose them as base64.

    9.0.0release notes

  • A message is now everything read in one pass, up to 256 KiB, rather than one network read. Back-to-back data may therefore match as one message, and forwarded messages can be larger.

    9.0.0release notes

  • Binary expectation response delays are now applied in order without holding a thread; empty response data means no reply.

    9.0.0release notes

  • Binary proxying now applies backpressure instead of buffering unlimited replies when clients do not read; writes stall without dropping data.

    9.0.0release notes

  • The binary proxy listener is called as soon as each message is read, on its own thread; its response is the first upstream bytes after that message or null.

    9.0.0release notes

  • The Java client's callback and breakpoint WebSockets now use the same trust and client-certificate settings as its HTTP requests.

    9.0.0release notes

  • Clearing with a DNS or binary matcher now clears only matching expectations; an empty request matcher clears all expectations and, for log/all types, matched DNS and binary log entries too.

    9.0.0release notes

  • The Java client trusts only the configured CA chain for MockServer's certificate; include MockServer's CA if it signs the server certificate.

    9.0.0release notes

  • With control-plane mTLS, Java clients trust only this chain for MockServer's certificate, and MockServer accepts only client certificates signed by this chain.

    9.0.0release notes

  • Rust struct literals for Delay now need to set newly added fields, or callers can use the provided constructors or builders.

    9.0.0release notes

  • Five distroless image variants move from Java 17 to Java 25, while -clustered moves to Java 21.

    9.0.0release notes

  • MockServer now refuses to start when DNS mocking is enabled but its DNS port cannot be used.

    9.0.0release notes

  • The setting and its Java methods are removed; configured values are ignored, and per-message forwarding cannot be restored.

    9.0.0release notes

  • Undecodable upstream responses now produce a 502 naming the cause and close the bad connection instead of relaying partial data or reusing it.

    9.0.0release notes

  • The Go client moves to the /v9 module path; update go get commands and imports from the /v7 or unsuffixed paths.

    9.0.0release notes

  • The Go client module moves to the /v9 path; update go get commands and imports to use it.

    9.0.0release notes

  • HTTP/2 and HTTP/3 HEAD responses no longer carry a body, including forwarded responses; tunnelled responses preserve the headers a direct connection sends.

    9.0.0release notes

  • HTTP/3 startup now refuses a UDP port already held by another application on macOS.

    9.0.0release notes

  • Setting the HTTP/3 port without the required native, or when the UDP port cannot be used, now prevents startup instead of silently degrading.

    9.0.0release notes

  • Rust struct literals for HttpTemplate now need to set newly added fields, or callers can use the provided constructors or builders.

    9.0.0release notes

  • Idle client connections now close after five minutes by default; set the timeout to 0 to restore the previous behavior.

    9.0.0release notes

  • When expectations in an initialization file repeat an id, the last one is kept in the first occurrence's position, matching PUT /mockserver/expectation behavior.

    9.0.0release notes

  • The container heap cap drops from 75% to 45% of the memory limit. A 256 MiB limit is no longer supported unless a small explicit heap is set.

    9.0.0release notes

  • DNS and HTTP/3 ports now bind to localBoundIP as well; clients must send those requests to that address when it is set.

    9.0.0release notes

  • Binary expectations now match messages on proxied binary connections by default; set the option to false to always forward, as in 8.0.0.

    9.0.0release notes

  • The setting now limits HTTP/2 and HTTP/3 request headers and upstream response headers as well as HTTP/1.1 headers. Its default is 256 KB; set it to 8192 to retain the old HTTP/2 and HTTP/3 limit.

    9.0.0release notes

  • The default changed from unlimited to 256 KB, applying uniformly across protocols.

    9.0.0release notes

  • This setting caps per-expectation mismatch log entries per request, defaulting to 50; set it to -1 to log every comparison. Matching and closest-match results are unchanged.

    9.0.0release notes

  • Oversized request bodies now receive 413 instead of a reset; HTTP/3 compressed bodies are limited by decompressed size.

    9.0.0release notes

  • The metric now has a reason label with values ring_full and in_flight_bytes; scripts and PromQL queries that assumed an unlabelled metric may need adjustment.

    9.0.0release notes

  • The metric now counts evicted entries rather than eviction episodes, so values are much larger and alerts need retuning.

    9.0.0release notes

  • The Node client now has an exports map that permits named package paths and blocks unlisted deep paths with ERR_PACKAGE_PATH_NOT_EXPORTED.

    9.0.0release notes

  • The package now has an exports map, so imports of unlisted internal paths fail to resolve.

    9.0.0release notes

  • The deep-import TypeScript typings no longer declare a default export; import from mockserver-client itself, use a namespace or require import, or enable esModuleInterop.

    9.0.0release notes

  • Its TypeScript typings now describe a plain object of named exports rather than a default export; the .default property is no longer typed.

    9.0.0release notes

  • The package now publishes its TypeScript typings, which use Node's types and therefore require @types/node.

    9.0.0release notes

  • A Node callback is no longer re-registered with its full times limit after MockServer removes its expectation; reconnects occur only while the expectation remains.

    9.0.0release notes

  • The launcher runs the bundled Java runtime directly without a shell and passes arguments separately; MOCKSERVER_JAVA_OPTS is split on whitespace with quoted text kept together, and spawnOptions.shell is ignored.

    9.0.0release notes

  • The Node browser transport now rejects 4xx and 5xx responses as the Node transport does.

    9.0.0release notes

  • withStyle and withSchemaType now return a new instance instead of mutating the existing instance; callers must use the returned value to observe the change.

    9.0.0release notes

  • withStyle and withSchemaType now return a new instance instead of mutating the existing instance; callers must use the returned value to observe the change.

    9.0.0release notes

  • Verification now counts only requests for the matched OpenAPI operation; verifySequence behavior is unchanged.

    9.0.0release notes

  • Now rejects instead of hanging when MockServer answers with an error.

    9.0.0release notes

  • withStyle now returns a new instance instead of mutating the existing instance; callers must use the returned value to observe the change.

    9.0.0release notes

  • The PHP launcher builds a quoted cmd.exe command line on Windows and throws BinaryInstallException for unsafe arguments or more than one percent sign across the path and arguments.

    9.0.0release notes

  • The MCP server now rejects calls missing required arguments with JSON-RPC error -32602 and names the missing arguments in data.missingArguments; null counts as missing.

    9.0.0release notes

  • Unknown fields now produce a 400 instead of silently checking at least one message; count constraints belong inside count.

    9.0.0release notes

  • On Windows, the launcher invokes cmd.exe with quoted arguments and raises ValueError for unsafe characters or more than one percent sign across the path and extra arguments.

    9.0.0release notes

  • Bodies whose bytes are already materialized are replayed verbatim instead of being decoded with replacement characters and re-encoded when the declared charset does not match the bytes.

    9.0.0release notes

  • Response verification now applies body matchers in verify and verifySequence instead of silently replacing them with an empty-object match.

    9.0.0release notes

  • A client that stops reading a response is now disconnected or reset after one minute by default; set this to 0 to disable the timeout.

    9.0.0release notes

  • The Python client now returns a DnsRequestDefinition or dict for DNS requests instead of an empty HttpRequest.

    9.0.0release notes

  • The Python client now returns a DnsRequestDefinition or dict for DNS requests instead of an empty HttpRequest.

    9.0.0release notes

  • The Java client now throws for control-plane errors instead of returning the error's text.

    9.0.0release notes

  • The Java client now raises for status codes of 400 or greater instead of returning the error text as its result.

    9.0.0release notes

  • An unfiltered listing includes expectations whose request matcher is not(...); DNS/binary filters return only matching expectations.

    9.0.0release notes

  • The Java client now throws for control-plane errors instead of returning the error's text.

    9.0.0release notes

  • The Java client now raises for status codes of 400 or greater instead of returning the error text as its result.

    9.0.0release notes

  • The Node client's TypeScript return type changes to Promise<RequestDefinition[]>; narrow each result to HttpRequest before reading HTTP-specific fields.

    9.0.0release notes

  • The Node client's return type is now Promise<RequestDefinition[]> rather than Promise<HttpResponse[]>; narrow results before using HTTP-specific fields.

    9.0.0release notes

  • The Node client's TypeScript return type changes to Promise<RequestDefinition[]>; narrow each result to HttpRequest before reading HTTP-specific fields.

    9.0.0release notes

  • The Node client's return type is now Promise<RequestDefinition[]> rather than Promise<HttpResponse[]>; narrow results before using HTTP-specific fields.

    9.0.0release notes

  • Enums are now non-exhaustive and server-sent unknown values map to Unknown; Unknown cannot be serialized back to the server.

    9.0.0release notes

  • Public enums are now non-exhaustive, requiring wildcard match arms; server-sent enums gain an Unknown variant that cannot be sent back.

    9.0.0release notes

  • Mutating the set returned by this method is no longer observed; change Subject Alternative Name lists through Configuration methods.

    9.0.0release notes

  • Mutating the set returned by this method is no longer observed; change Subject Alternative Name lists through Configuration methods.

    9.0.0release notes

  • Start failures now reject with an Error when Java cannot run or exits before readiness; failed starts clean up the launched process, and polling has a timeout.

    9.0.0release notes

  • Response status codes outside 100–999 are now rejected; invalid entries in initialization or persisted expectations are skipped with a warning.

    9.0.0release notes

  • Stop failures and timeouts now reject and stop the launched process; refusal or server errors no longer resolve as if MockServer stopped.

    9.0.0release notes

  • TCP chaos latency and bandwidth now behave like a slow link: inbound data stays ordered, bandwidth is shared per connection, and latency plus bandwidth settings add together.

    9.0.0release notes

  • The option is now on by default, so a failing or invalid response or forward template returns 500 rather than 404 or 502.

    9.0.0release notes

  • A verification with an upper bound now fails rather than passing when the event log is truncated.

    9.0.0release notes

  • Verification sequences now check DNS/binary steps and match requests as received when redaction is enabled; verification kinds that cannot count DNS/binary traffic are rejected with 400.

    9.0.0release notes

  • No longer passes when the server rejected the call or could not be reached.

    9.0.0release notes

Security 5

  • The Ruby launcher builds a quoted cmd.exe command line on Windows and raises MockServer::Error for unsafe arguments; it no longer uses a shell on Linux or macOS.

    9.0.0release notes

  • The launcher builds a quoted cmd.exe command line on Windows and refuses launcher paths containing a double quote, line break, NUL, or more than one percent sign.

    9.0.0release notes

  • The launcher builds a quoted cmd.exe command line on Windows and refuses launcher paths containing a double quote, line break, NUL, or more than one percent sign.

    9.0.0release notes

  • The launcher builds a quoted cmd.exe command line on Windows and refuses launcher paths containing a double quote, line break, NUL, or more than one percent sign.

    9.0.0release notes

  • Internal x-http2 headers are no longer leaked into recorded, matched, or forwarded requests and responses.

    9.0.0release notes

Deprecations 2

  • http_request remains supported as a deprecated alias of request_override.

    9.0.0release notes

  • http_response remains supported as a deprecated alias of response_override.

    9.0.0release notes

New APIs and options 38

  • Helm adds a pre-stop sleep setting, defaulting to 0 and requiring Kubernetes 1.30 or newer.

    9.0.0release notes

  • Helm adds a termination grace period setting, defaulting to 45 seconds, for graceful draining.

    9.0.0release notes

  • Binary responses can select whether to answer only, answer and forward while dropping the server reply, or forward and replace the server reply.

    9.0.0release notes

  • Bounds how long a callback waits for its client id; callback and breakpoint registration rejects if the id does not arrive within the configured timeout.

    9.0.0release notes

  • Go, .NET and Rust add a typed CHECK_FAILURE_RATE threshold metric for load scenarios.

    9.0.0release notes

  • Closes callback and breakpoint WebSockets without resetting MockServer.

    9.0.0release notes

  • The selected DNS port can be read from ClientAndServer, including the instance injected by the JUnit 5 extension.

    9.0.0release notes

  • Python and Ruby clients gained a conditional-matcher type.

    9.0.0release notes

  • Go adds conditional request matcher fields and a ConditionalRequest(...) helper.

    9.0.0release notes

  • Python can build and read conditional if/then/else request matchers using if_request, then_request, else_request and not_condition.

    9.0.0release notes

  • Typed client calls compare a described request with every active expectation, field by field.

    9.0.0release notes

  • Typed client calls explain which expectation would serve a recorded request, why earlier expectations were passed over, which lower-priority expectations it hides, and how the request was handled.

    9.0.0release notes

  • Typed client calls list the closest expectations for recent unmatched requests, optionally with a suggested JSON patch for each.

    9.0.0release notes

  • Forward loops back to MockServer stop after 10 hops with 508 Loop Detected; setting the limit to 0 disables the forwarding header.

    9.0.0release notes

  • The dashboard uses this authenticated, redacted endpoint to load full bodies for entries whose displayed bodies are truncated.

    9.0.0release notes

  • Rust and PHP add a helper for building conditional request matchers.

    9.0.0release notes

  • .NET adds If, Then and Else fields and the RequestIf(...) helper for conditional request matchers.

    9.0.0release notes

  • The Java client sends and exposes the primary flag, allowing a primary response action to be combined with a second action.

    9.0.0release notes

  • Configures the maximum input length for deterministicFromInput embedding mocks, which now default to a 1,048,576-character limit.

    9.0.0release notes

  • Python, Go, .NET, Rust and PHP load-scenario steps can specify per-step checks and a checks list.

    9.0.0release notes

  • Rust load steps gain name(...) and label(key, value) methods, and load scenarios gain label(key, value).

    9.0.0release notes

  • The Rust client's LoadThresholdMetric enum gains the CheckFailureRate variant.

    9.0.0release notes

  • The enum gains a CheckFailureRate variant for the new per-step load check threshold.

    9.0.0release notes

  • The event log is now bounded by size as well as count. The setting is enabled by default, using a heap-based limit; set it to 0 to restore count-only bounding.

    9.0.0release notes

  • Delayed responses are capped to bound resource use; requests within the limit are unaffected.

    9.0.0release notes

  • Queued template actions are capped to bound resource use; requests within the limit are unaffected.

    9.0.0release notes

  • A new metric is provided for pending delayed tasks.

    9.0.0release notes

  • A new metric counts response write stalls, labelled by protocol and scope.

    9.0.0release notes

  • A new metric counts WebSocket read pauses.

    9.0.0release notes

  • Builder types now live in this module, which can be augmented instead of mockserver-client/llm.

    9.0.0release notes

  • Set this property to false to opt out of the dev-mode defaults used by the JUnit rule and extension.

    9.0.0release notes

  • The Spring listener exposes the selected DNS port through the ${mockServerDnsPort} placeholder.

    9.0.0release notes

  • The new @MockServerDnsPort annotation exposes the selected DNS port.

    9.0.0release notes

  • The selected DNS port can be read from MockServerRule.

    9.0.0release notes

  • @MockServerTest now accepts mockserver.dnsEnabled and mockserver.dnsPort.

    9.0.0release notes

  • Python and Ruby clients now support per-step load checks.

    9.0.0release notes

  • The Java client adds a method to retrieve recorded request definitions, including DNS queries and binary messages.

    9.0.0release notes

  • TurnBuilder is now declared alongside the other builder constructors.

    9.0.0release notes

Performance 6

  • The event-log thread now batches wake-ups while traffic flows, reducing CPU use; log entries may reach the console, disk capture, and dashboard up to 10 ms later.

    9.0.0release notes

  • The receive buffer is sized up to reduce stalls with curl's OpenSSL QUIC stack; raise the host's net.core.rmem_max for the full 4 MiB buffer.

    9.0.0release notes

  • The GraalVM engine is shared process-wide and parsed scripts are cached; template rendering uses a dedicated bounded pool so saturated renders do not block unrelated event-loop work.

    9.0.0release notes

  • Shutdown is effectively instant after removing a redundant fixed Netty quiet-period wait.

    9.0.0release notes

  • Disk capture is cheaper and batches writes. Output lines may differ byte-for-byte while parsing to the same JSON; a hard kill can lose up to 8 KB of recent lines.

    9.0.0release notes

  • Three forwarding and proxy-pass paths no longer block a pool thread for the full upstream round trip, increasing proxy concurrency with a small thread pool.

    9.0.0release notes

Behavior and default changes 24

  • Binary proxying now keeps one upstream connection for the client's whole connection, relays TLS on that connection, and tunnels through configured upstream proxies.

    9.0.0release notes

  • Closest-match comparisons now stop after the first 1,000 expectations in serving order; the hint indicates when it was truncated.

    9.0.0release notes

  • Unexpected internal failures now return a 500 with a generic message and correlation id; invalid requests remain 400 responses.

    9.0.0release notes

  • HTTP/2 tunnels now answer 100 Continue themselves and pass the request and full body once; unsupported expectations receive 417 and oversized bodies receive 413.

    9.0.0release notes

  • Forwarded-request metrics now label at most 500 distinct upstream hosts; additional hosts are grouped under _other.

    9.0.0release notes

  • HTTPS and SOCKS upstream proxies now resolve destination host names themselves instead of requiring MockServer to resolve them.

    9.0.0release notes

  • Invalid forwarding keys or certificates and undecodable upstream responses do not trigger retries; idempotent requests are retried once on a fresh connection after a pooled connection closes on reuse.

    9.0.0release notes

  • Uploads abandoned by the client are logged once at INFO rather than ERROR with a stack trace; nothing is logged at WARN or ERROR.

    9.0.0release notes

  • An HTTP/2 upstream connection may now open only one stream of its own at a time, with the same per-stream body-piece limit.

    9.0.0release notes

  • Docker images now use ZGC by default; -aot retains G1. Overriding JAVA_TOOL_OPTIONS replaces the default options, so include -XX:+UseZGC to retain ZGC.

    9.0.0release notes

  • The JUnit 5 extension now defaults to dev mode, using maxLogEntries=1000 and maxExpectations=1000 instead of heap-derived sizes; set mockserver.devMode=false or raise the caps if deeper history is needed.

    9.0.0release notes

  • The JUnit 4 rule now defaults to dev mode, using maxLogEntries=1000 and maxExpectations=1000 instead of heap-derived sizes; set mockserver.devMode=false or raise the caps if deeper history is needed.

    9.0.0release notes

  • Log entries now include each request or response body once; message, arguments, and proxied-exchange expectation bodies use short forms instead of repeating full bodies.

    9.0.0release notes

  • Peer-closed or reset connections are logged at cause-appropriate levels in MockServer's own log; set DEBUG to see the quieter entries.

    9.0.0release notes

  • The default cap rises from 100,000 to 250,000 on large heaps; the effective default also scales with the reduced container heap cap.

    9.0.0release notes

  • The default is now 50 instead of -1, limiting logged expectation mismatch entries per request without changing matching or verification behavior.

    9.0.0release notes

  • A new metric counts drift analyses skipped when the backlog fills, rather than allowing the backlog to grow without limit.

    9.0.0release notes

  • CommonJS-style imports work with or without esModuleInterop; default imports require esModuleInterop.

    9.0.0release notes

  • When MockServer runs as its own process, Netty off-heap buffer memory is capped by default at a quarter of max heap, with a 64 MiB minimum and a cap no greater than heap; reaching the cap closes the connection that…

    9.0.0release notes

  • With transparentProxyEnabled, PROXY-prefixed connections are parsed and matched or recorded as HTTP, and remote-address callbacks and templates see the real client address.

    9.0.0release notes

  • Calls filtered by request now also return error log entries associated with that request.

    9.0.0release notes

  • Calls filtered by request now also return error log entries associated with that request.

    9.0.0release notes

  • Inbound and outbound TLS handshakes now use this timeout, with a 20-second default, instead of a hard-coded 10-second limit.

    9.0.0release notes

  • Verifying by the id of a DNS or binary expectation now counts the DNS queries or binary messages that expectation answered.

    9.0.0release notes

Tooling 1

  • The Node client typings now declare this existing runtime method, with a typed Har document as its resolved value.

    9.0.0release notes

Fixes and other changes 32

  • .NET and Rust clients can now read a load scenario using the CHECK_FAILURE_RATE threshold.

    9.0.0release notes

  • Tunnel handling now preserves streamed responses, isolates request and stream failures, routes known destinations through MockServer matching, and avoids losing or duplicating requests in the described edge cases.

    9.0.0release notes

  • HTTP/3 request bodies with content encodings are decompressed for matching and forwarding, while original compressed bytes are retained.

    9.0.0release notes

  • verify, verifyNever, and sequence verification now count DNS and binary requests matched by request or expectation id.

    9.0.0release notes

  • Python, Ruby, Rust, Go, .NET and PHP clients now support building and reading back previously missing expectation fields, including overrides, matchers, response settings, templates and action settings.

    9.0.0release notes

  • Expectation.from_dict no longer drops an OpenAPI request matcher.

    9.0.0release notes

  • HTTPS forward-proxying now pools HTTP/2 upstream connections, reducing local-port exhaustion under sustained load.

    9.0.0release notes

  • HTTP/2 gRPC streams, including server reflection, now end normally when the client ends its request with trailers instead of closing the connection and other streams.

    9.0.0release notes

  • After-raw-response pipelined exchanges now preserve the next response on the same connection.

    9.0.0release notes

  • Mocked 1xx-only responses, or 1xx responses with a body or trailers, are sent as interim responses followed by a clean stream reset instead of hanging clients or breaking connections.

    9.0.0release notes

  • Unexpected upstream connection errors now fail pending forwards, send GOAWAY, close the connection, and prevent its reuse from the pool.

    9.0.0release notes

  • HTTP/3 bodies without Content-Encoding retain the bytes received when forwarded; text without a charset still uses ISO-8859-1, while JSON and XML default to UTF-8.

    9.0.0release notes

  • The HTTP/3 UDP port is released when the server stops or fails to start, allowing immediate restart or another application to bind it.

    9.0.0release notes

  • Python's HttpOverrideForwardedRequest now supports request_override and response_override, sends overrides under accepted names alongside modifiers or response_template, and reads overrides back from MockServer.

    9.0.0release notes

  • Reading back a Java API header or query parameter added with an empty or null value list no longer throws NullPointerException.

    9.0.0release notes

  • Header sections exactly at the configured limit are accepted regardless of how network reads split the final header line.

    9.0.0release notes

  • The minimum is now 1 byte; zero or negative values no longer produce inconsistent body limits across protocols.

    9.0.0release notes

  • The minimum is now 1 byte; zero or negative values no longer produce inconsistent body limits across protocols.

    9.0.0release notes

  • A Java client callback whose WebSocket registration fails no longer occupies a WebSocket expectation slot.

    9.0.0release notes

  • Named imports now work; previously only the default import worked.

    9.0.0release notes

  • Named ES-module imports in the Node client and launcher were fixed.

    9.0.0release notes

  • The bypass list now applies consistently to HTTP, HTTPS, and SOCKS upstream proxies; leading-dot suffixes and normalized IPv6 addresses are supported.

    9.0.0release notes

  • The PHP client now sends an empty request matcher as an object rather than an array.

    9.0.0release notes

  • Free-port helpers no longer return a port another application is listening on at 127.0.0.1 or ::1.

    9.0.0release notes

  • The Python synchronous client now exposes respond_with_grpc_bidi, previously available only on its async sibling.

    9.0.0release notes

  • Proxied response headers, trailers, and cookies beginning with matcher marker characters are recorded literally rather than parsed as matcher syntax.

    9.0.0release notes

  • Retrieving log messages without a request matcher now includes messages about DNS and binary requests.

    9.0.0release notes

  • Rust clients can now parse load scenarios that omit abortOnFail, thresholds, stages, rows or captures, which previously failed to parse.

    9.0.0release notes

  • The Node launcher now honors the configured startupRetries value instead of always reading it as 500.

    9.0.0release notes

  • Verification.from_dict no longer drops an OpenAPI request matcher.

    9.0.0release notes

  • The Python synchronous client now exposes with_chaos, previously available only on its async sibling.

    9.0.0release notes

  • The Python synchronous client now exposes with_steps, previously available only on its async sibling.

    9.0.0release notes