Mockttp
github.com
- Free plan
- Windows
- macOS
- Linux
- Web
- Self-hosted
What Mockttp is
Mockttp is a free, open-source JavaScript library for intercepting, transforming, and testing HTTP requests and responses. It supports HTTP integration tests in Node.js and browsers, including transparent proxying and HTTPS, and can form the basis of custom proxies that capture, inspect, or rewrite traffic. The library can stub responses, verify requests, generate self-signed certificates for HTTPS mocking, and mock traffic inside or outside its process. Parallel tests can use automatically configured ports, mock URLs, and proxy settings. Mockttp works with promise-capable testing tools and HTTP clients. Mocha, Chai, and Superagent appear in an example, but are optional. Browser tests need an admin server running outside the browser because browsers cannot start an HTTP server or proxy themselves. The setup guide warns against trusting a test certificate authority system-wide or sharing its private key, as either could let an attacker impersonate secure connections. Mockttp is published as a JavaScript library in a public GitHub repository; HTTP Toolkit’s commercial product features are separate from the library.
Who it suits
It suits JavaScript developers building HTTP integration tests or custom proxies. Browser test setups need an admin server outside the browser, and certificate handling requires care.
Good to know, and what to watch
- Supports HTTP tests in Node.js and browsers.
- Can stub responses and verify requests.
- Mocks HTTPS using generated self-signed certificates.
- Automates ports and proxy settings for parallel tests.
- Works with promise-capable test tools and HTTP clients.
- Browser tests require an external admin server.
- Trusting a test CA system-wide can risk secure connections.
- Sharing the test CA private key can enable impersonation.
Plans
Every plan and priceProfessional
Team
Hobbyist
Open source
Getting started
- Open the Mockttp project on GitHub
- Install and use the JavaScript library in a supported environment
- Choose Node.js or browser-based HTTP integration testing
- Start an administrator server outside the browser for browser tests
- Configure proxying, HTTPS certificates, mocks, or dynamic responses
- Connect your preferred promise-capable test tool and HTTP client
Limits to check
Browser testing cannot start an HTTP server or proxy from inside the browser, so an external administrator server is required. The setup guidance also warns against trusting a test certificate authority system-wide or sharing its private key.
The verdict
Mockttp provides request interception and mocking tools for JavaScript tests and proxy workflows. Browser setup and certificate handling are key considerations before using it.
Questions people ask
Is Mockttp free?
Yes. Mockttp is published as free, open-source software.
Which protocols does it support?
It supports HTTP, HTTPS, WebSocket, and JSON-RPC.
Can it run browser integration tests?
Yes. Browser tests are supported, but they need an administrator server running outside the browser.
Can Mockttp create a proxy?
Yes. It can be used to build proxies that capture, inspect, or rewrite traffic.
Which testing tools integrate with it?
An example uses Mocha, Chai, and Superagent. These are optional; Mockttp can work with other promise-capable testing tools and HTTP clients.
What the maker publishes
- Browser setup
- Browser tests require an admin server started outside the browser because browsers cannot start an HTTP server or proxy themselves. source
- Commercial product distinction
- HTTP Toolkit lists automated HTTP mocking and rewriting among Professional plan features, while Mockttp itself is published as a JavaScript library in a public GitHub repository. source
- Desktop platforms
- HTTP Toolkit provides installation packages for Windows, Mac, and Linux. source
- HTTPS certificate caution
- The setup guide warns against trusting a test CA system-wide or sharing its private key, because doing so could let an attacker impersonate secure connections. source
- HTTP Toolkit privacy
- HTTP Toolkit says HTTP request and response contents are never collected and are stored only locally on the user’s machine. source
- Integrations
- The README example uses Mocha, Chai, and Superagent, while noting that these tools are optional and Mockttp can work with other promise-capable testing tools and HTTP clients. source
- Maker and location
- The HTTP Toolkit privacy policy identifies Toolshed Labs SLU as the operator and gives its address in Barcelona, Spain. source
- Mocking features
- The library can stub responses, verify requests, mock HTTPS with generated self-signed certificates, and mock traffic inside or outside its process. source
- Parallel testing
- Mockttp supports parallel mocking with automatically configured ports, mock URLs, and proxy settings. source
- Proxy use
- Mockttp can be used to build custom HTTP proxies that capture, inspect, or rewrite traffic. source
- Security support
- The latest published Mockttp version is actively supported, and the preceding major version receives security fixes for six months after the next major release. source
- Testing use
- Mockttp supports HTTP integration tests that can run in Node.js and browsers, including transparent proxying and HTTPS. source
- Vulnerability reporting
- Mockttp vulnerabilities can be reported through GitHub’s private security reporting channels, and confirmed vulnerabilities are to be fixed and published as advisories within 90 days. source
- What Mockttp does
- Mockttp intercepts, transforms, or tests HTTP requests and responses in JavaScript. source
Checked against the maker's pages on 4 Oct 2026.