{"id":20801499,"url":"https://github.com/harish2704/node-proxy-kutti","last_synced_at":"2025-05-07T00:12:31.608Z","repository":{"id":43007138,"uuid":"249266334","full_name":"harish2704/node-proxy-kutti","owner":"harish2704","description":"A Simple and transparent caching forward proxy with minimal dependencies. Useful for caching various package manager files like rpm, deb etc with in local network, especially while building containers. Can cache https request using MITM ","archived":false,"fork":false,"pushed_at":"2022-03-23T17:52:48.000Z","size":10,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T18:46:00.920Z","etag":null,"topics":["caching-proxy","http-proxy","https-traffic","mitm","proxy-server"],"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/harish2704.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":"2020-03-22T20:25:59.000Z","updated_at":"2023-05-03T20:20:03.000Z","dependencies_parsed_at":"2022-09-07T16:52:25.867Z","dependency_job_id":null,"html_url":"https://github.com/harish2704/node-proxy-kutti","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harish2704%2Fnode-proxy-kutti","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harish2704%2Fnode-proxy-kutti/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harish2704%2Fnode-proxy-kutti/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harish2704%2Fnode-proxy-kutti/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harish2704","download_url":"https://codeload.github.com/harish2704/node-proxy-kutti/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252788531,"owners_count":21804284,"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":["caching-proxy","http-proxy","https-traffic","mitm","proxy-server"],"created_at":"2024-11-17T18:18:36.557Z","updated_at":"2025-05-07T00:12:31.582Z","avatar_url":"https://github.com/harish2704.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Proxy-kutti\nSimple and transparent caching forward proxy server written in Nodejs.\n\n## Features\n* It has only one dependency ( `node-forge` )\n    - it is used for creating self-signed certificates dynamically for MITM https proxy server.\n* By default configuration, it will indefinitely cache all http requests irrespective of their cache headers.\n* All cached data is transparently saved to a cache directory with simple file structure.\n    - Contents are saved as it \u0026 headers are saved as a json file. It can be viewed/edited later\n* If Root CA certificates are provided, then MITM HTTPS proxy server will get enabled and HTTPS Traffic also will get cached.\n* We can specify URL rewrite rules to avoid caching of same data from different mirror sites.\n    - This feature will help to work with default configuration of YUM/DNF utilities which will be using different mirrors in each time.\n\n\n## Installation\n\n`npm i proxy-kutti`\n\n## Configuration\n\n* proxy-kutti will listen on `127.0.0.1:8080` by default ( without any configuration )\n* All the configuration variables can be permanently stored in configuration file\n* We can even specify different configuration file using `PROXY_KUTTI_CONFIG` environment variable.\n* All the values specified in configuration file can be overridden by setting corresponding `PROXY_KUTTI_\u003cconfig key\u003e` environment variable.\n* Multiple `url_rewrites` rules can be specified by providing space separated list of rewrite rules.\n* `url_rewrite` rule, follows format used by `s` subcommand of `sed` command.\n    The first and last charecter of the rewrite rule should be same and the same charecter is used as separator.\n* To install root CA in a CentOS-7 system, do the following\n    - `root@host# cp \u003crootCA.*\u003e /etc/pki/ca-trust/source/anchors/`\n    - `root@host# update-ca-trust`\n\n\n## Example Usage\n\n`env PROXY_KUTTI_host=0.0.0.0 npx proxy-kutti`\n\n**shell Output**\n```\nProxy-kutti is running...\n\nUsing env variables\n  PROXY_KUTTI_CONFIG=/home/user/.config/proxy-kutti/config.js\n\nCurrent Configuration ( edit /home/user/.config/proxy-kutti/config.(json|js)  or set env variable PROXY_KUTTI_\u003cconfig-key\u003e=\u003cvalue\u003e to change )\n  \"port\": 8080,\n  \"host\": \"0.0.0.0\",\n  \"cache_dir\": \"/home/user/.cache/proxy-kutti\",\n  \"root_ca_key\": \"/home/user/.config/proxy-kutti/rootCA.key\",\n  \"root_ca_cert\": \"/home/user/.config/proxy-kutti/rootCA.pem\",\n  \"url_rewrites\": \"#http://(.*)/7.7.1908/#http://mirrors.centos/7.7.1908/# #http[s]://(.*)epel/7/x86_64/#http://mirror.epel/7/x86_64/#\"\n\n\nRun the following command shell to start using this proxy\n  export http_proxy=http://0.0.0.0:8080\n  export https_proxy=http://0.0.0.0:8080\n\n  \n2020-03-22T20:21:33.624Z Miss GET https://example.com/making-request-for-first-time =\u003e /home/user/.cache/proxy-kutti/https/example.com/GET/making-request-for-first-time.data\n2020-03-22T20:21:55.839Z Miss GET https://github.com/ =\u003e /home/user/.cache/proxy-kutti/https/github.com/GET/#index.data\n2020-03-22T20:26:31.251Z Miss GET https://github.com/harish2704/node-proxy-kutti/archive/master.zip =\u003e /home/user/.cache/proxy-kutti/https/github.com/GET/harish2704/node-proxy-kutti/archive/master.zip.data\n2020-03-22T20:27:23.087Z Miss GET https://example.com/again-making-those-requests =\u003e /home/user/.cache/proxy-kutti/https/example.com/GET/again-making-those-requests.data\n2020-03-22T20:27:35.043Z Hit! GET https://github.com/ =\u003e /home/user/.cache/proxy-kutti/https/github.com/GET/#index.data\n2020-03-22T20:27:38.237Z Hit! GET https://github.com/harish2704/node-proxy-kutti/archive/master.zip =\u003e /home/user/.cache/proxy-kutti/https/github.com/GET/harish2704/node-proxy-kutti/archive/master.zip.data\n\n```\n\n## Configuring MITM proxy for HTTPS traffic.\n\nTo cache HTTPS traffic , a root CA certificate has to provided to proxy server.\nThen the same root CA has to be installed as a trusted CA on all the client systems.\nOtherwise \"invalid issuer\" error will raise during any https request.\n\nopenssl command line can be used to generated Root CA certificate.\nFor details please use / refer the gist [ generate-certificate-openssl.sh ](https://gist.github.com/harish2704/6cc7185c2fe36ec9cb4e912c4e74f781)\n\nRoot CA certificates has to be placed in the location pointed by `root_ca_cert` \u0026 `root_ca_key` configuration values.\n\n\n## Example structure of cache directory\n\n```\n.\n└── https\n    ├── example.com\n    │   └── GET\n    │       ├── again-making-those-requests.data\n    │       ├── again-making-those-requests.data.meta\n    │       ├── making-request-for-first-time.data\n    │       └── making-request-for-first-time.data.meta\n    └── github.com\n        └── GET\n            ├── harish2704\n            │   └── node-proxy-kutti\n            │       └── archive\n            │           ├── master.zip.data\n            │           └── master.zip.data.meta\n            ├── #index.data\n            └── #index.data.meta\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharish2704%2Fnode-proxy-kutti","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharish2704%2Fnode-proxy-kutti","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharish2704%2Fnode-proxy-kutti/lists"}