A TypeScript proxy framework for intercepting and processing HTTP/1.1, HTTPS, WebSocket, and secure WebSocket traffic.
mitm-core gives Node.js applications a foundation for observing and customizing proxied traffic, with configurable processing, rules, and plugins.
Subscribe to connection, request, WebSocket, and error events as traffic moves through the proxy.
Explore proxy events →Add behavior through plugin lifecycle hooks and work with the request scope.
Read the plugin guide →Define matching rules and manage rule stores for decisions such as TLS bypass.
Learn about rules →Set certificate handling, caching, pipelines, and timeout behavior to fit your use case.
View configuration →Install the package in your Node.js project:
npm install mitm-coreCreate a proxy with your Root CA credentials:
import { readFileSync } from "node:fs";
import { Proxy } from "mitm-core";
const proxy = new Proxy({
rootCa: {
cert: readFileSync("./creds/__self__/CA.pem"),
key: readFileSync("./creds/__self__/key.pem"),
},
});
await proxy.listen(8001);Then send a request through it:
curl -x http://127.0.0.1:8001 http://example.com/HTTPS interception requires a Root CA and a client configured to trust it. Only inspect traffic you own or are authorized to inspect.