{"id":18410652,"url":"https://github.com/vfk/inbetween","last_synced_at":"2025-04-12T22:46:29.817Z","repository":{"id":13922174,"uuid":"16621554","full_name":"VFK/inbetween","owner":"VFK","description":"Minimal HTTP MITM-proxy for Node.js","archived":false,"fork":false,"pushed_at":"2014-02-09T15:02:21.000Z","size":136,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T21:32:34.007Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VFK.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-07T17:13:11.000Z","updated_at":"2019-05-06T17:58:36.000Z","dependencies_parsed_at":"2022-09-26T20:01:33.398Z","dependency_job_id":null,"html_url":"https://github.com/VFK/inbetween","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2Finbetween","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2Finbetween/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2Finbetween/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2Finbetween/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VFK","download_url":"https://codeload.github.com/VFK/inbetween/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239092738,"owners_count":19580214,"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-06T03:33:13.541Z","updated_at":"2025-02-16T05:28:30.704Z","avatar_url":"https://github.com/VFK.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inbetween [![NPM version][npm-image]][npm-url]\n\nA fast and simple MITM-proxy for Node.js. No https support for now.\n\n## Installation\n\nInstall `inbetween` via NPM:\n```shell\nnpm install inbetween\n```\n\nCreate `main.js` like so:\n```javascript\nvar Proxy = require('inbetween');\nvar proxy = new Proxy(8080);\n```\n\nRun your `main.js`:\n```shell\nnode main.js\n```\n\nThat's it, now tell you apps to use **localhost:8080** as an HTTP proxy.\n\n## API\n\n#### proxy.rewriteUrl(url)\nType: `String`  \nFull URL, for example http://something.com/index.php?test=true\n\nSimple example:\n```javascript\n// Route any request to nodejs website\nproxy.rewriteUrl = function(url) {\n    url = 'http://nodejs.org';\n    return url;\n}\n```\n\nAdvanced example:\n```javascript\n// Make http://test.com?hello=world to be http://test.com?hello=wild\nvar qs = require('querystring');\n....\nproxy.rewriteUrl = function(url) {\n    var parts = url.split('?');\n    if (parts.length === 2) {\n        var obj = qs.parse(parts[1]);\n        obj['hello'] = 'wild';\n        parts[1] = qs.stringify(obj);\n    }\n    return parts.join('?');\n}\n```\nRemember to always return your url.\n\n#### proxy.rewriteHeaders(headers)\nType: `Object`  \nRequest headers. More info in Node.js docs: [http.IncomingMessage.headers](http://nodejs.org/api/http.html#http_message_headers)\n\n```javascript\n// Spoof user-agent\nproxy.rewriteHeaders = function(headers) {\n    headers['user-agent'] = 'NSA-agent v3.5.7';\n    return headers;\n}\n```\nRemember to always return your headers object.\n\n#### proxy.rewriteData(data)\nType: `String`  \nPOST data. Usually looks like *user=MegaDestroyer98\u0026password=123321*  \nRewrite it the same way as you rewrite an url.  \nRemember to always return your data.\n\n[npm-url]: https://npmjs.org/package/inbetween\n[npm-image]: https://badge.fury.io/js/inbetween.png","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfk%2Finbetween","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvfk%2Finbetween","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfk%2Finbetween/lists"}