[!TIP] 歡迎加入「Xget 開源與 AI 交流群」,一起交流開源專案、AI 應用、工程實踐、效率工具和獨立開發;如果你也在做產品、寫程式、折騰專案或者對開源和 AI 感興趣,歡迎進群認識更多認真做事、樂於分享的朋友。
面向開發者資源的超高效能、安全、一體化加速引擎,為程式碼託管、模型和資料集中心、軟體包管理儲存庫、容器註冊表、AI 推理供應商等提供統一、高效的加速,同時替你處理快取、重試、安全回應標頭,以及各種協定相容行為。
技術深度解析文章:《深入剖析 Xget:一個高效能、多協定、高安全性的開發者資源加速引擎》。
受邀入駐 GitCode,並被認證為 G-Star 畢業專案。作為「一個被廣泛使用的公共專案」,獲得 OpenAI 的 Codex for Open Source 計畫支援,也獲得多位技術博主自發推薦,包括阮一峰、GitHubDaily、魚 C、玄離 199 等。感謝所有支持、分享、推薦和實際使用 Xget 的個人、團隊與社群。
[!NOTE] 下方徽章會跳轉到 README 中對應的使用或部署章節。
預部署實例:xget.xi-xu.me - 僅適合評估與試用,正式環境或對可用性敏感的場景建議自行部署。
[!WARNING] 如果你選擇自託管,除非你明確要做公開鏡像,否則請至少加上驗證、IP 白名單,或同時啟用兩者。
URL 轉換器:xuc.xi-xu.me - 一鍵轉換任意支援平台的 URL 為 Xget 的加速格式
Agent Skills:npx skills add xixu-me/skills -s xget
X-Performance-Metrics
回應標頭暴露階段性耗時資訊Strict-Transport-Security:強制 HTTPS 傳輸,預防中間人攻擊X-Frame-Options: DENY:防止點擊劫持攻擊Content-Security-Policy:嚴格的內容安全策略Referrer-Policy:控制參照來源資訊洩露Permissions-Policy:預設限制瀏覽器中的隱私敏感能力X-XSS-Protection:面向舊版瀏覽器的相容性回應標頭POST、PUT、PATCH 和 DELETEPerformanceMonitor 類別,即時追蹤請求各階段耗時X-Performance-Metrics 回應標頭提供詳細效能數據/info/refs、/git-upload-pack、/git-receive-pack)service=git-upload-pack 等查詢參數git clone:完整儲存庫克隆,支援淺克隆和分支指定git push:程式碼推送和分支管理git pull/fetch:增量更新和遠端同步git submodule:子模組遞迴克隆git/2.34.1)graph TD
Request[使用者請求 / User-Agent] --> Identify{識別平台}
Identify -->|無效| Error[返回錯誤]
Identify -->|有效| Transform[轉換路徑]
Transform --> CheckProtocol{檢查協定}
CheckProtocol -->|Git| GitHandler[Git 協定適配器]
CheckProtocol -->|Docker| DockerHandler[Docker 協定適配器]
CheckProtocol -->|AI| AIHandler[AI 推理適配器]
CheckProtocol -->|標準| StdHandler[標準適配器]
GitHandler --> Upstream[獲取上游]
DockerHandler --> Upstream
AIHandler --> Upstream
StdHandler --> CacheCheck{檢查快取}
CacheCheck -->|命中| ReturnCache[返回快取回應]
CacheCheck -->|未命中| Upstream
Upstream -->|成功| ProcessResponse[處理回應]
Upstream -->|失敗| Retry{重試?}
Retry -->|是| Wait["等待 (退避)"] --> Upstream
Retry -->|否| Error
ProcessResponse --> Finalize[添加標頭並返回]
Finalize --> Response[回應]
classDiagram
class Worker {
+fetch(request)
}
class AppHandler {
+handleRequest(request, env, ctx)
}
class PlatformCatalog {
+PLATFORM_CATALOG
}
class PlatformRouting {
+transformPath()
+resolveTarget()
}
class Validation {
+validateRequest()
+isDockerRequest()
}
class GitProtocol {
+configureGitHeaders()
+isGitRequest()
}
class DockerProtocol {
+handleDockerAuth()
+fetchToken()
}
class AIProtocol {
+configureAIHeaders()
}
class UpstreamPipeline {
+tryReadCachedResponse()
+fetchUpstreamResponse()
}
class ResponsePipeline {
+finalizeResponse()
}
class Security {
+addSecurityHeaders()
}
class Performance {
+monitor()
}
Worker --> AppHandler
AppHandler --> PlatformCatalog
AppHandler --> PlatformRouting
AppHandler --> Validation
AppHandler --> GitProtocol
AppHandler --> DockerProtocol
AppHandler --> AIProtocol
AppHandler --> UpstreamPipeline
AppHandler --> ResponsePipeline
AppHandler --> Security
AppHandler --> Performance
PlatformRouting --> PlatformCatalog
使用預部署實例 xget.xi-xu.me
或您自己部署的實例,只需簡單替換網域並新增平台前綴:
| 平台 | 平台前綴 | 原始 URL 格式 | 加速 URL 格式 |
|---|---|---|---|
| GitHub | gh |
https://github.com/... |
https://xget.xi-xu.me/gh/... |
| GitHub Gist | gist |
https://gist.github.com/... |
https://xget.xi-xu.me/gist/... |
| GitLab | gl |
https://gitlab.com/... |
https://xget.xi-xu.me/gl/... |
| Gitea | gitea |
https://gitea.com/... |
https://xget.xi-xu.me/gitea/... |
| Codeberg | codeberg |
https://codeberg.org/... |
https://xget.xi-xu.me/codeberg/... |
| SourceForg |