CheckOps
Mockttp
Mockttp is an Apache-2.0 JavaScript library from HTTP Toolkit for intercepting, transforming and testing HTTP(S) requests and responses with a real proxy, in Node.js and browsers.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
Mockttp lets you intercept, transform or test HTTP requests and responses in JavaScript. It powers HTTP Toolkit and can be used for integration testing or to build custom proxies.
The README contrasts it with in-process stubbing: many tools stub HTTP functions inside one JavaScript process, which ties you to an environment and does not test the real requests your code sends. Mockttp runs a real HTTP(S) server and proxy, so it can mock requests from any process, browser or language, and it works in Node.js and in browser tests.
Tests start a mock server, define rules such as forGet('/users').thenReply(200, ...), run the code, and then check which requests were seen. HTTPS interception with generated certificates is built in.
In the quality loop it supports integration and end-to-end tests that need realistic HTTP mocking.
Features
- Real proxy: Mocks requests from any process.
- Rules API: Match and respond, forward, or transform.
- HTTPS support: Generated CA and certificates.
- Request assertions: Inspect seen requests.
- Browser and Node: Use in both environments.
Pros
- Realistic: Tests real network calls rather than stubs.
Cons
- JavaScript API: Mocks are defined in JS/TS.
- Proxy setup: Clients must be configured to use the proxy.
Usage and Links (Example)
const mockttp = require('mockttp');
const server = mockttp.getLocal();
await server.start(8080);
await server.forGet('/users/1').thenReply(200, JSON.stringify({ id: 1 }));
Resources:
Pricing
See site.
Recommended for?
- JavaScript teams needing real HTTP mocking across processes.
- Not a fit for simple in-process mocks; MSW or nock are lighter.
Conclusion
Mockttp is a powerful, maintained library for realistic HTTP mocking and interception.
On CheckOps, Mockttp is filed under the Integration testing and API & contract testing stages. Related tools listed here include Mock Service Worker (MSW), Nock, WireMock, MockServer, HTTP Toolkit and MirageJS. Before choosing, compare them on licence, supported languages and platforms, hosting model, and how well each fits your existing CI pipeline. Facts on this page were checked against the official website, documentation and repository on 11 November 2026; statements the vendor makes about its own product are marked as vendor claims.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with Mockttp side by side.
MMock Service Worker (MSW)Mock Service Worker (MSW) is an MIT-licensed API mocking library that intercepts network requests at the network level in browsers (via a Service Worker) and Node.js, for REST, GraphQL and WebSocket APIs.Compare with Mockttp
NNockHTTP server mocking and expectations library for Node.js.Compare with Mockttp
WWireMockA tool for mocking HTTP services.Compare with Mockttp
MMockServerOpen-source HTTP/1.1, HTTP/2, HTTP/3, HTTPS and gRPC mock server, recording proxy, and MCP server for AI assistants.Compare with Mockttp
HHTTP ToolkitHTTP Toolkit is an open-source (AGPL-3.0) cross-platform HTTP(S) debugging proxy, analyser and client for intercepting, inspecting, rewriting and mocking traffic from browsers, mobile apps and backend code.Compare with Mockttp
MMirageJSA client-side server to build, test and share your JavaScript app.Compare with Mockttp