0.3.0 ⢠Published 1 year ago
@nickhudkins/malcolm v0.3.0
š“š» Malcolm (in the Middle)
It's Man-In-The-Middle-Proxy for Development
Usage
Create a proxy.config.ts
:
import { defineConfig } from "@nickhudkins/malcolm";
export default defineConfig({
hosts: ["google.com"],
handleRequest: async (req) => {
const url = new URL(req.url);
return {
ctx: {
requestURL: url,
}
}
},
handleResponse: (
res: PassThroughResponse,
ctx
) => {
// I have `ctx`! which is provided by the above
return;
},
};
Run malcolm
Development
Working in this directory?Clone and npm run start:dev
ā¤ļø Made with Love by @nickhudkins