{"id":28780456,"url":"https://github.com/shuakami/proxy","last_synced_at":"2026-04-09T16:13:34.121Z","repository":{"id":298859193,"uuid":"1001352273","full_name":"shuakami/proxy","owner":"shuakami","description":"一个部署在 Vercel 上的高性能智能缓存代理。A high-performance, intelligent caching proxy deployed on Vercel.","archived":false,"fork":false,"pushed_at":"2025-06-13T09:05:39.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-13T09:38:37.004Z","etag":null,"topics":["cache","nodejs","proxy","redis","serverless","vercel"],"latest_commit_sha":null,"homepage":"https://proxy.sdjz.wiki","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shuakami.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-13T08:29:00.000Z","updated_at":"2025-06-13T09:05:42.000Z","dependencies_parsed_at":"2025-06-13T09:49:46.976Z","dependency_job_id":null,"html_url":"https://github.com/shuakami/proxy","commit_stats":null,"previous_names":["shuakami/proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shuakami/proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuakami%2Fproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuakami%2Fproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuakami%2Fproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuakami%2Fproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shuakami","download_url":"https://codeload.github.com/shuakami/proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuakami%2Fproxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260415154,"owners_count":23005508,"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":["cache","nodejs","proxy","redis","serverless","vercel"],"created_at":"2025-06-17T18:06:57.818Z","updated_at":"2026-04-09T16:13:34.113Z","avatar_url":"https://github.com/shuakami.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# proxy \n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FShuakami%2Fproxy)\n\n`proxy` 是一个部署在 Vercel 平台上的高性能、智能缓存的代理系统。\n\n它几乎可以代理任何HTTP请求，包括GET、POST、PUT、DELETE、PATCH等。\n\n得益于多层缓存机制（Vercel Edge Network + Redis）和动态缓存策略，它可以极快的加速对任何公共 URL 的访问，同时显著降低源站负载和带宽成本。\n\n## 工作原理\n\n```mermaid\ngraph TD\n    A[\"👨‍💻 User Request\"] --\u003e B{\"Vercel Edge Cache?\"};\n    B -- \"✅ HIT\" --\u003e C[\"⚡️ Fast Data Transfer\"];\n    B -- \"❌ MISS\" --\u003e D[\"λ Vercel Function\"];\n    D --\u003e E{\"Redis Cache?\"};\n    E -- \"✅ HIT\" --\u003e F[\"📦 Serve from Redis\"];\n    F --\u003e G[\"Cache on Edge\"];\n    G --\u003e C;\n    E -- \"❌ MISS\" --\u003e H[\"☁️ Request Origin\"];\n    H --\u003e I[\"⏱️ Dynamic Cache Logic\"];\n    I --\u003e J[\"💾 Store in Redis\"];\n    J --\u003e G;\n    C --\u003e K[\"✅ Response to User\"];\n```\n\n## 核心特性 ✨\n\n-   **多层缓存**: 结合 Vercel Edge Network 的 CDN 缓存和 Redis 的内存数据库缓存，实现极致的响应速度。\n-   **动态缓存算法**: 智能地根据源站的响应速度动态调整缓存时间。源站越慢，缓存时间越长，最大化性能收益。\n-   **统计面板**: 提供 `/api/stats` 端点，实时监控代理的运行状态，包括总请求数、缓存命中率、代理流量等。\n-   **Git 协议优化**: 能够识别并正确处理 `git` 协议请求，确保 `git clone/fetch` 等操作的兼容性，同时跳过对此类动态请求的缓存。\n-   **易于部署**: 只需一个 Vercel 账户和一个 Redis 实例即可轻松部署。\n\n\n## 部署指南 🛠️\n\n1.  **一键部署**: 点击上方的 \"Deploy with Vercel\" 按钮，Vercel 将引导您完成仓库克隆和项目创建。\n\n2.  **设置环境变量**:\n    在 Vercel 项目的设置中，找到 \"Environment Variables\" 选项，添加一个名为 `REDIS_URL` 的变量，其值为您 Redis 实例的连接字符串。\n    \n    *   例如: `redis://:your_password@your_redis_host:your_redis_port`\n\n3.  **完成部署**:\n    Vercel 会自动完成部署。部署成功后，您就可以开始使用您的代理了。\n\n## 使用示例 🚀\n\n\u003e 这里的proxy.sdjz.wiki 是我自己部署的服务，你也可以换成你自己的域名\n\n\n### 1. 加速 `git clone`\n\n您可以通过代理来克隆任何公共 Git 仓库，这在网络不佳时能显著提升下载速度。\n\n```bash\n# 克隆本项目\ngit clone https://proxy.sdjz.wiki/https://github.com/Shuakami/proxy.git\n```\n\n### 2. 代理网页或 API\n\n直接在代理地址后拼接上您想访问的完整 URL 即可。\n\n*   **访问网站**:  \n    [https://proxy.sdjz.wiki/https://www.example.com](https://proxy.sdjz.wiki/https://www.example.com)\n\n*   **代理原始文件** (例如，查看 GitHub 上的文件):  \n    [https://proxy.sdjz.wiki/https://raw.githubusercontent.com/Shuakami/proxy/master/api/index.js](https://proxy.sdjz.wiki/https://raw.githubusercontent.com/Shuakami/proxy/master/api/index.js)\n\n### 3. 加速包管理器下载\n\n您可以临时或永久地为 `npm` 或 `pip` 等包管理器配置代理，以加快依赖安装速度。\n\n*   **NPM 示例**:\n    ```bash\n    npm config set registry https://proxy.sdjz.wiki/https://registry.npmjs.org/\n    ```\n\n*   **Pip 示例**:\n    ```bash\n    pip install --index-url https://proxy.sdjz.wiki/https://pypi.org/simple/ \u003cpackage_name\u003e\n    ```\n\n## 许可证\n\n本项目基于[AGPL v3](https://www.gnu.org/licenses/agpl-3.0)许可证进行开源。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuakami%2Fproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuakami%2Fproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuakami%2Fproxy/lists"}