{"id":18544762,"url":"https://github.com/131/mitm-proxy","last_synced_at":"2025-05-15T05:34:15.314Z","repository":{"id":57298477,"uuid":"104593424","full_name":"131/mitm-proxy","owner":"131","description":"Mitm https proxy","archived":false,"fork":false,"pushed_at":"2017-09-26T20:00:21.000Z","size":24,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T09:16:43.344Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/131.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-23T19:26:55.000Z","updated_at":"2020-12-13T23:27:14.000Z","dependencies_parsed_at":"2022-08-26T15:55:30.552Z","dependency_job_id":null,"html_url":"https://github.com/131/mitm-proxy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fmitm-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fmitm-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fmitm-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fmitm-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/131","download_url":"https://codeload.github.com/131/mitm-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254282738,"owners_count":22045128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T20:17:32.284Z","updated_at":"2025-05-15T05:34:15.282Z","avatar_url":"https://github.com/131.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mitm-proxy\nAn ES7 (async/await) supported version of [node-http-mitm-proxy](https://github.com/joeferner/node-http-mitm-proxy).\n\n# CA\nMove all ca related stuffs to a dedicated [mitm-ca](https://github.com/131/mitm-ca) module.\nDrop sni/wildcard support (for now). Proxy constructor now need a CA instance.\n\n# WS\nRemove all WS related features (for now)\n\n# Plugins\nReplace .use with async event flow.\n\n# Logs \u0026 traces\nUse [debug](https://github.com/tj/debug) for traces. Start proxy with DEBUG=* to view all traces.\n\n\n# APIs\n\n```\n\"use strict\";\n\nconst CA    = require('mitm-ca/fs');\nconst ca    = new CA('.trashmeca');\n\nconst Proxy = require('mitm-http');\nconst gunzip = require('mitm-http/middleware/gunzip');\n\nconst proxy = new Proxy(ca);\n\n\n\nproxy.onError(function(ctx, err) {\n  console.error('proxy error:', err);\n});\n\nproxy.on('onRequest', async function(ctx) {\n  if (ctx.req.headers.host.indexOf('.google.') !== -1) {\n    gunzip(ctx);\n    ctx.onResponseData(function(ctx, chunk) {\n      chunk = new Buffer(chunk.toString().replace(/\u003ch3.*?\u003c\\/h3\u003e/g, '\u003ch3\u003ePwned!\u003c/h3\u003e'));\n      return chunk;\n    });\n  }\n});\n\nproxy.listen({port: 8080}, function(){\n  console.log(\"Now listening\");\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fmitm-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F131%2Fmitm-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fmitm-proxy/lists"}