{"id":17312860,"url":"https://github.com/9seconds/httransform","last_synced_at":"2025-08-21T06:42:29.146Z","repository":{"id":34859660,"uuid":"159488510","full_name":"9seconds/httransform","owner":"9seconds","description":"A framework to build precise and fast HTTP proxies.","archived":false,"fork":false,"pushed_at":"2023-03-06T22:31:11.000Z","size":529,"stargazers_count":57,"open_issues_count":2,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-16T09:00:07.683Z","etag":null,"topics":["http-proxies","mitm","mitmproxy","proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","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/9seconds.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-28T11:03:57.000Z","updated_at":"2024-06-18T22:30:16.000Z","dependencies_parsed_at":"2024-06-18T20:13:09.729Z","dependency_job_id":null,"html_url":"https://github.com/9seconds/httransform","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/9seconds/httransform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9seconds%2Fhttransform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9seconds%2Fhttransform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9seconds%2Fhttransform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9seconds%2Fhttransform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9seconds","download_url":"https://codeload.github.com/9seconds/httransform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9seconds%2Fhttransform/sbom","scorecard":{"id":6480,"data":{"date":"2025-08-11","repo":{"name":"github.com/9seconds/httransform","commit":"0167957537bc38073f0b313aa9fb9a4bb3f135c7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/9seconds/httransform/codeql-analysis.yml/master?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3372 / GHSA-6wxm-mpqj-6jpf","Warn: Project is vulnerable to: GO-2025-3554 / GHSA-528q-4pgm-wvg2","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T13:39:13.325Z","repository_id":34859660,"created_at":"2025-08-14T13:39:13.325Z","updated_at":"2025-08-14T13:39:13.325Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271436568,"owners_count":24759361,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["http-proxies","mitm","mitmproxy","proxy"],"created_at":"2024-10-15T12:44:51.648Z","updated_at":"2025-08-21T06:42:29.078Z","avatar_url":"https://github.com/9seconds.png","language":"Go","readme":"httransform\n===========\n\n[![Build Status](https://github.com/9seconds/httransform/workflows/CI/badge.svg)](https://github.com/9seconds/httransform)\n[![codecov](https://codecov.io/gh/9seconds/httransform/branch/master/graph/badge.svg?token=cyMF66trUZ)](https://codecov.io/gh/9seconds/httransform)\n[![Go Reference](https://pkg.go.dev/badge/github.com/9seconds/httransform/v2.svg)](https://pkg.go.dev/github.com/9seconds/httransform/v2)\n\nhttransform is the library/framework to build your own HTTP\nproxies. It relies on high-performant and memory-efficient\n[fasthttp](https://github.com/valyala/fasthttp) library as HTTP base\nlayer and can give you the ability to build a proxy where you can control\nevery aspect.\n\nMain features of this framework:\n\n1. Support of HTTP (plain HTTP) proxy protocol.\n2. Support of HTTPS (with CONNECT method) protocol. This library does MITM\n   and provides the possibility to generate TLS certificates for the hosts\n   on-the-fly.\n3. Keeps and maintains the order of headers and their case (no normalization).\n4. Supports the concept of _layers_ or middlewares which process HTTP\n   requests and responses.\n5. Supports custom _executors_: a function which converts HTTP requests to\n   HTTP responses. Allowing your proxy to fetch the data from other services,\n   which are not necessarily HTTP. The executor simply converts HTTP request\n   structure to HTTP response.\n6. Can support connection upgrades (this includes _websockets_) with an\n   ability to look into them.\n\nPlease check the [full\ndocumentation](https://pkg.go.dev/github.com/9seconds/httransform/v2) for\nmore details.\n\nExample\n-------\n\nJust a small example to give you the feeling of how it all looks like:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"net\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/9seconds/httransform/v2\"\n\t\"github.com/9seconds/httransform/v2/auth\"\n\t\"github.com/9seconds/httransform/v2/layers\"\n)\n\n// These are generates examples of self-signed certificates\n// to simplify the example.\nvar caCert = []byte(`-----BEGIN CERTIFICATE-----\nMIICWzCCAcSgAwIBAgIJAJ34yk7oiKv5MA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTgxMjAyMTQyNTAyWhcNMjgxMTI5MTQyNTAyWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\ngQDL7Hzfmx7xfFWTRm26t/lLsCZwOri6VIzp2dYM5Hp0dV4XUZ+q60nEbHwN3Usr\nGKAK/Rsr9Caam3A18Upn2ly69Tyr29kVK+PlsOgSSCUnAYcqT166/j205n3CGNLL\nOPtQKfAT/iH3dPBObd8N4FR9FlXiYIiAp1opCbyu2mlHiwIDAQABo1MwUTAdBgNV\nHQ4EFgQUOJ+uGtIhHxXHPNESBNI4YbwAl+wwHwYDVR0jBBgwFoAUOJ+uGtIhHxXH\nPNESBNI4YbwAl+wwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9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1Zyb5DQC6duX46zEBzti9oWx0DJIQRZifeCvw\n4J45NsSQjuuAAWs=\n-----END PRIVATE KEY-----`)\n\nfunc main() {\n\t// Root context is crucial here. When root context is closed, a\n\t// proxy is shutdown.\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\t// For demo purpose we are going to close by SIGINT and SIGTERM\n\t// signals.\n\tsignals := make(chan os.Signal, 1)\n\n\tsignal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)\n\n\tgo func() {\n\t\tfor range signals {\n\t\t\tcancel()\n\t\t}\n\t}()\n\n\t// Filter layer is required if you want to drop request\n\t// which are made to you internal networks.\n\tfilterLayer, err := layers.NewFilterSubnetsLayer([]net.IPNet{\n\t\t{IP: net.ParseIP(\"127.0.0.0\"), Mask: net.CIDRMask(8, 32)},\n\t\t{IP: net.ParseIP(\"172.16.0.0\"), Mask: net.CIDRMask(12, 32)},\n\t\t{IP: net.ParseIP(\"10.0.0.0\"), Mask: net.CIDRMask(8, 32)},\n\t\t{IP: net.ParseIP(\"192.168.0.0\"), Mask: net.CIDRMask(16, 32)},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\topts := httransform.ServerOpts{\n\t\tTLSCertCA:     caCert,\n\t\tTLSPrivateKey: caPrivateKey,\n\t\t// We are going to use basic proxy authorization with username\n\t\t// 'user' and password 'password'.\n\t\tAuthenticator: auth.NewBasicAuth(map[string]string{\n\t\t\t\"user\": \"password\",\n\t\t}),\n\t\tLayers: []layers.Layer{\n\t\t\tfilterLayer,\n\t\t\t// This guy will remove Proxy headers from the request.\n\t\t\tlayers.ProxyHeadersLayer{},\n\t\t\t// This guy is going to limit request processing time to 3\n\t\t\t// minutes.\n\t\t\tlayers.TimeoutLayer{\n\t\t\t\tTimeout: 3 * time.Minute,\n\t\t\t},\n\t\t},\n\t}\n\n\tproxy, err := httransform.NewServer(ctx, opts)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// We bind our proxy to the port 3128 and all interfaces.\n\tlistener, err := net.Listen(\"tcp\", \":3128\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := proxy.Serve(listener); err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\nThis will create an HTTP proxy on `127.0.0.1:3128`. It will also require\nauthentication (`user` and `password`) and will remove the `Proxy-Authorization`\nheader before sending the request further.\n\n\nv1 version\n----------\n\nVersion 1 is not supported anymore. Please use version 2. Version 2 has\na lot of breaking changes but which really help to maintain a package.\n\nUnfortunately, I cannot enumerate all of them and I understand that it\nis going to make your life painful in some moments. Sorry for that. v2\nwas a complete rewrite and I assume that given a size of this library,\nit won't take a lot of time for you to migrate. But if you have any\nquestions, feel free to open an issue. I'm happy to help.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9seconds%2Fhttransform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9seconds%2Fhttransform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9seconds%2Fhttransform/lists"}