# Xget 🚀

[](https://zread.ai/xixu-me/Xget)
[](https://deepwiki.com/xixu-me/Xget)
[](#-生態系統整合)
[](#-生態系統整合)
[](#部署到-cloudflare-workers)
[](#部署到-edgeone-pages)
[](#部署到-vercel)
[](#部署到-netlify)
[](#部署到-deno-deploy)
[](#自託管部署)
[](#自託管部署)
[English](README.md) | [汉语(简体)](README.zh-Hans.md) | **漢語(繁體)**
[](#github)
[](#gitlab)
[](#gitea)
[](#codeberg)
[](#sourceforge)
[](#aosp-android-開源專案)
[](#hugging-face-鏡像)
[](#civitai-ai-模型平台)
[](#npm-軟體包管理加速)
[](#python-軟體包管理加速)
[](#conda-軟體包管理加速)
[](#maven-軟體包管理加速)
[](#apache-軟體下載加速)
[](#gradle-軟體包管理加速)
[](#homebrew-軟體包管理加速)
[](#ruby-軟體包管理加速)
[](#r-軟體包管理加速)
[](#perl-軟體包管理加速)
[](#texlatex-軟體包管理加速)
[](#go-模組加速)
[](#nuget-軟體包管理加速)
[](#rust-軟體包管理加速)
[](#php-軟體包管理加速)
[](#flathub-儲存庫鏡像)
[](#debianubuntu-apt-配置)
[](#debianubuntu-apt-配置)
[](#fedora-dnf-配置)
[](#rocky-linux-dnf-配置)
[](#opensuse-zypper-配置)
[](#arch-linux-pacman-配置)
[](#arxiv-論文下載)
[](#f-droid-儲存庫鏡像)
[](#jenkins-外掛程式下載)
[](#容器註冊表)
[](#ai-推理供應商)
面向開發者資源的超高效能、安全、一體化加速引擎,其效能顯著優於傳統解決方案,為程式碼儲存庫、模型和資料集中心、軟體包註冊表、容器註冊表、AI 推理供應商等提供統一、高效的加速。
技術深度解析文章已發布:**[《深入剖析 Xget:一個高效能、多協定、高安全性的開發者資源加速引擎》](https://blog.xi-xu.me/en/2025/10/07/Deep-Dive-into-Xget.html)**。
Xget 已受邀入駐
[GitCode 平台](https://gitcode.com/xixu-me/xget),並被認證為 G-Star 畢業專案;同時也獲得多位技術博主自發推薦,包括[阮一峰](https://www.ruanyifeng.com/blog/2025/12/weekly-issue-379.html#:~:text=Xget)、[GitHubDaily](https://x.com/i/status/1956204203937829256)、[魚 C](https://www.bilibili.com/video/BV1EeeBzVEop/)、[玄離 199](https://www.bilibili.com/video/BV197hqzsE8Y/?t=8)
等。在此感謝 GitCode 的肯定,也感謝每一位分享、推薦與實際使用 Xget 的朋友。
## 🎯 快速開始
**預部署實例(不保證可靠性):`xget.xi-xu.me`**
**URL 轉換器:**[**`xuc.xi-xu.me`**](https://xuc.xi-xu.me) - 一鍵轉換任意支援平台的 URL 為 Xget 的加速格式
**Agent Skills:**[**`skills/xget/`**](skills/xget/) - 可作為獨立的 `/xget`
目錄直接安裝到 skills 目錄中
## 🌟 核心優勢 - 為什麼選擇 Xget?
### ⚡ 極速效能 - 突破傳統加速器瓶頸
- **⚡ 毫秒級回應**:Cloudflare 全球 330+ 邊緣節點,平均回應時間 < 50ms
- **🌐
HTTP/3 極速協定**:啟用最新 HTTP/3 協定,連線延遲降低 40%,傳輸速度提升 30%
- **📦 智慧多重壓縮**:gzip、deflate、brotli 三重壓縮演算法,傳輸效率提升 60%
- **🔗 零延遲預連線**:連線預熱和保持活躍,消除握手開銷,實現秒級回應
- **⚡ 平行分片下載**:完整支援 HTTP Range 請求,多執行緒下載速度倍增
- **🎯 智慧路由最佳化**:自動選擇最佳傳輸路徑,避開網路壅塞節點
### 🌐 多平台深度整合
- **一站式多平台支援**:統一支援各種開發場景中的主流平台
- **智慧識別與轉換**:自動識別平台前綴並轉換為目標平台的正確 URL 結構
- **一致的加速體驗**:無論檔案類型或來源,均可享受統一且穩定的極速下載體驗
### 🔒 企業級安全保障
- **多層安全標頭**:
- `Strict-Transport-Security`:強制 HTTPS 傳輸,預防中間人攻擊
- `X-Frame-Options: DENY`:防止點擊劫持攻擊
- `X-XSS-Protection`:內建 XSS 防護機制
- `Content-Security-Policy`:嚴格的內容安全策略
- `Referrer-Policy`:控制參照來源資訊洩露
- **請求驗證機制**:
- HTTP 方法白名單:常規請求限制為 GET/HEAD,而 Git/LFS、容器映像倉庫、AI 推理與 Hugging Face API 請求會按需允許 `POST`、`PUT`、`PATCH` 和 `DELETE`
- 路徑長度限制:防止超長 URL 攻擊(最大 2048 字元)
- 輸入清理:防止路徑遍歷和注入攻擊
- **逾時保護**:30 秒請求逾時,防止資源耗盡和惡意請求
### 🚀 現代架構與可靠性
- **智慧重試機制**:
- 最大 3 次重試,線性延遲策略(1000ms × 重試次數)
- 自動錯誤恢復,提高下載成功率
- 逾時檢測和中斷處理
- **高效快取策略**:
- 1800 秒(30 分鐘)預設快取時長,顯著減少原始伺服器壓力
- Git 操作跳過快取,確保即時性
- 基於 Cloudflare Cache API 的邊緣快取
- **效能監控系統**:
- 內建 `PerformanceMonitor` 類別,即時追蹤請求各階段耗時
- 透過 `X-Performance-Metrics` 回應標頭提供詳細效能數據
- 支援快取命中率統計和最佳化建議
### 🎯 Git 協定完全相容
- **智慧協定檢測**:
- 自動識別 Git 特定端點(`/info/refs`、`/git-upload-pack`、`/git-receive-pack`)
- 檢測 Git 用戶端 User-Agent 模式
- 支援 `service=git-upload-pack` 等查詢參數
- **完整操作支援**:
- `git clone`:完整儲存庫克隆,支援淺克隆和分支指定
- `git push`:程式碼推送和分支管理
- `git pull/fetch`:增量更新和遠端同步
- `git submodule`:子模組遞迴克隆
- **協定最佳化**:
- 保持 Git 專用請求標頭和驗證資訊
- 智慧 User-Agent 處理(預設 `git/2.34.1`)
- 支援 Git LFS 大檔案傳輸
### 📱 生態系統整合
- **專用瀏覽器擴充功能**:[Xget Now](https://github.com/xixu-me/Xget-Now)
提供無縫體驗
- 自動 URL 轉址,無需手動修改 URL
- 支援自訂 Xget 實例網域
- 多平台偏好設定和黑白名單管理
- 本地處理,確保隱私安全
- **下載工具相容性**:完美支援 wget、cURL、aria2、IDM 等主流下載工具
- **CI/CD 整合**:可直接在 GitHub Actions、GitLab CI 等環境中使用
## 🏗️ 系統架構
### 請求處理流程
```mermaid
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[回應]
```
### 組件架構
```mermaid
classDiagram
class Worker {
+handleRequest(request)
}
class Config {
+PLATFORMS
+transformPath()
}
class Validation {
+validateRequest()
+isDockerRequest()
}
class GitProtocol {
+configureGitHeaders()
+isGitRequest()
}
class DockerProtocol {
+handleDockerAuth()
+fetchToken()
}
class AIProtocol {
+configureAIHeaders()
}
class Security {
+addSecurityHeaders()
}
class Performance {
+monitor()
}
Worker --> Config
Worker --> Validation
Worker --> GitProtocol
Worker --> DockerProtocol
Worker --> AIProtocol
Worker --> Security
Worker --> Performance
```
## 📖 URL 轉換規則
使用預部署實例 **`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/...` |
| SourceForge | `sf` | `https://sourceforge.net/...` | `https://xget.xi-xu.me/sf/...` |
| AOSP | `aosp` | `https://android.googlesource.com/...` | `https://xget.xi-xu.me/aosp/...` |
| Hugging Face | `hf` | `https://huggingface.co/...` | `https://xget.xi-xu.me/hf/...` |
| Civitai | `civitai` | `https://civitai.com/...` | `https://xget.xi-xu.me/civitai/...` |
| npm | `npm` | `https://registry.npmjs.org/...` | `https://xget.xi-xu.me/npm/...` |
| PyPI | `pypi` | `https://pypi.org/...` | `https://xget.xi-xu.me/pypi/...` |
| conda | `conda` | `https://repo.anaconda.com/...` 和 `https://conda.anaconda.org/...` | `https://xget.xi-xu.me/conda/...` 和 `https://xget.xi-xu.me/conda/community/...` |
| Maven | `maven` | `https://repo1.maven.org/...` | `https://xget.xi-xu.me/maven/...` |
| Apache | `apache` | `https://downloads.apache.org/...` | `https://xget.xi-xu.me/apache/...` |
| Gradle | `gradle` | `https://plugins.gradle.org/...` | `https://xget.xi-xu.me/gradle/...` |
| Homebrew | `homebrew` | `https://github.com/Homebrew/...` | `https://xget.xi-xu.me/homebrew/...` |
| RubyGems | `rubygems` | `https://rubygems.org/...` | `https://xget.xi-xu.me/rubygems/...` |
| CRAN | `cran` | `https://cran.r-project.org/...` | `https://xget.xi-xu.me/cran/...` |
| CPAN | `cpan` | `https://www.cpan.org/...` | `https://xget.xi-xu.me/cpan/...` |
| CTAN | `ctan` | `https://tug.ctan.org/...` | `https://xget.xi-xu.me/ctan/...` |
| Go 模組 | `golang` | `https://proxy.golang.org/...` | `https://xget.xi-xu.me/golang/...` |
| NuGet | `nuget` | `https://api.nuget.org/...` | `https://xget.xi-xu.me/nuget/...` |
| Rust Crates | `crates` | `https://crates.io/...` | `https://xget.xi-xu.me/crates/...` |
| Packagist | `packagist` | `https://repo.packagist.org/...` | `https://xget.xi-xu.me/packagist/...` |
| Flathub | `flathub` | `https://dl.flathub.org/...` | `https://xget.xi-xu.me/flathub/...` |
| Debian | `debian` | `https://deb.debian.org/...` | `https://xget.xi-xu.me/debian/...` |
| Ubuntu | `ubuntu` | `https://archive.ubuntu.com/...` | `https://xget.xi-xu.me/ubuntu/...` |
| Fedora | `fedora` | `https://dl.fedoraproject.org/...` | `https://xget.xi-xu.me/fedora/...` |
| Rocky Linux | `rocky` | `https://download.rockylinux.org/...` | `https://xget.xi-xu.me/rocky/...` |
| openSUSE | `opensuse` | `https://download.opensuse.org/...` | `https://xget.xi-xu.me/opensuse/...` |
| Arch Linux | `arch` | `https://geo.mirror.pkgbuild.com/...` | `https://xget.xi-xu.me/arch/...` |
| arXiv | `arxiv` | `https://arxiv.org/...` | `https://xget.xi-xu.me/arxiv/...` |
| F-Droid | `fdroid` | `https://f-droid.org/...` | `https://xget.xi-xu.me/fdroid/...` |
| Jenkins 外掛程式 | `jenkins` | `https://updates.jenkins.io/...` | `https://xget.xi-xu.me/jenkins/...` |
| 容器註冊表 | `cr` | 見[容器註冊表](#容器註冊表) | 見[容器註冊表](#容器註冊表) |
| AI 推理供應商 | `ip` | 見 [AI 推理供應商](#ai-推理供應商) | 見 [AI 推理供應商](#ai-推理供應商) |
### 各平台轉換範例
#### GitHub
```url
# 原始 URL
https://github.com/microsoft/vscode/archive/refs/heads/main.zip
# 轉換後(新增 gh 前綴)
https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip
```
#### GitHub Gist
```url
# 原始 URL
https://gist.github.com/xixu-me/e2ea9db6b1f143892495f796fef18631/raw/3b8807172ee492d0da3a7e370b0fb88fc97b53e6/Free-ChatGPT-Paid-Plan.md
# 轉換後(新增 gist 前綴)
https://xget.xi-xu.me/gist/xixu-me/e2ea9db6b1f143892495f796fef18631/raw/3b8807172ee492d0da3a7e370b0fb88fc97b53e6/Free-ChatGPT-Paid-Plan.md
```
#### GitLab
```url
# 原始 URL
https://gitlab.com/gitlab-org/gitlab/-/archive/master/gitlab-master.zip
# 轉換後(新增 gl 前綴)
https://xget.xi-xu.me/gl/gitlab-org/gitlab/-/archive/master/gitlab-master.zip
```
#### Gitea
```url
# 原始 URL
https://gitea.com/gitea/gitea/archive/master.zip
# 轉換後(新增 gitea 前綴)
https://xget.xi-xu.me/gitea/gitea/gitea/archive/master.zip
```
#### Codeberg
```url
# 原始 URL
https://codeberg.org/forgejo/forgejo/archive/forgejo.zip
# 轉換後(新增 codeberg 前綴)
https://xget.xi-xu.me/codeberg/forgejo/forgejo/archive/forgejo.zip
```
#### SourceForge
```url
# 原始 URL
https://sourceforge.net/projects/sevenzip/files/7-Zip/23.01/7z2301-x64.exe/download
# 轉換後(新增 sf 前綴)
https://xget.xi-xu.me/sf/projects/sevenzip/files/7-Zip/23.01/7z2301-x64.exe/download
```
#### AOSP (Android 開源專案)
```url
# AOSP 專案原始 URL
https://android.googlesource.com/platform/frameworks/base
# 轉換後(新增 aosp 前綴)
https://xget.xi-xu.me/aosp/platform/frameworks/base
# AOSP 裝置樹原始 URL
https://android.googlesource.com/device/google/pixel
# 轉換後(新增 aosp 前綴)
https://xget.xi-xu.me/aosp/device/google/pixel
```
#### Hugging Face
```url
# 模型檔案原始 URL
https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin
# 轉換後(新增 hf 前綴)
https://xget.xi-xu.me/hf/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin
# 資料集檔案原始 URL
https://huggingface.co/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet
# 轉換後(新增 hf 前綴)
https://xget.xi-xu.me/hf/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet
```
#### Civitai
```url
# AI 模型下載原始 URL
https://civitai.com/api/download/models/128713
# 轉換後(新增 civitai 前綴)
https://xget.xi-xu.me/civitai/api/download/models/128713
# 模型 API 原始 URL
https://civitai.com/api/v1/models/7240
# 轉換後(新增 civitai 前綴)
https://xget.xi-xu.me/civitai/api/v1/models/7240
# 模型版本 API 原始 URL
https://civitai.com/api/v1/model-versions/128713
# 轉換後(新增 civitai 前綴)
https://xget.xi-xu.me/civitai/api/v1/model-versions/128713
```
#### npm
```url
# 軟體包檔案原始 URL
https://registry.npmjs.org/react/-/react-18.2.0.tgz
# 轉換後(新增 npm 前綴)
https://xget.xi-xu.me/npm/react/-/react-18.2.0.tgz
# 軟體包元資料原始 URL
https://registry.npmjs.org/lodash
# 轉換後(新增 npm 前綴)
https://xget.xi-xu.me/npm/lodash
```
#### PyPI
```url
# Python 軟體包檔案原始 URL
https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz
# 轉換後(新增 pypi 前綴)
https://xget.xi-xu.me/pypi/packages/source/r/requests/requests-2.31.0.tar.gz
# Wheel 檔案原始 URL
https://pypi.org/packages/py3/r/requests/requests-2.31.0-py3-none-any.whl
# 轉換後(新增 pypi 前綴)
https://xget.xi-xu.me/pypi/packages/py3/r/requests/requests-2.31.0-py3-none-any.whl
```
#### conda
```url
# 預設頻道軟體包檔案原始 URL
https://repo.anaconda.com/pkgs/main/linux-64/numpy-1.24.3-py311h08b1b3b_1.conda
# 轉換後(新增 conda 前綴)
https://xget.xi-xu.me/conda/pkgs/main/linux-64/numpy-1.24.3-py311h08b1b3b_1.conda
# 社群頻道元資料原始 URL
https://conda.anaconda.org/conda-forge/linux-64/repodata.json
# 轉換後(新增 conda/community 前綴)
https://xget.xi-xu.me/conda/community/conda-forge/linux-64/repodata.json
```
#### Maven
```url
# Maven 中央儲存庫 JAR 檔案原始 URL
https://repo1.maven.org/maven2/org/springframework/spring-core/5.3.21/spring-core-5.3.21.jar
# 轉換後(新增 maven 前綴)
https://xget.xi-xu.me/maven/maven2/org/springframework/spring-core/5.3.21/spring-core-5.3.21.jar
# Maven 元資料原始 URL
https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/maven-metadata.xml
# 轉換後(新增 maven 前綴)
https://xget.xi-xu.me/maven/maven2/org/apache/commons/commons-lang3/maven-metadata.xml
```
#### Apache 軟體下載
```url
# Apache 軟體下載原始 URL
https://downloads.apache.org/kafka/3.6.1/kafka_2.13-3.6.1.tgz
# 轉換後(新增 apache 前綴)
https://xget.xi-xu.me/apache/kafka/3.6.1/kafka_2.13-3.6.1.tgz
# Apache Maven 下載原始 URL
https://downloads.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz
# 轉換後(新增 apache 前綴)
https://xget.xi-xu.me/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz
# Apache Spark 下載原始 URL
https://downloads.apache.org/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz
# 轉換後(新增 apache 前綴)
https://xget.xi-xu.me/apache/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz
```
#### Gradle
```url
# Gradle 外掛程式入口網站 JAR 檔案原始 URL
https://plugins.gradle.org/m2/org/gradle/gradle-hello-world-plugin/0.2/gradle-hello-world-plugin-0.2.jar
# 轉換後(新增 gradle 前綴)
https://xget.xi-xu.me/gradle/m2/org/gradle/gradle-hello-world-plugin/0.2/gradle-hello-world-plugin-0.2.jar
# Gradle 外掛程式元資料原始 URL
https://plugins.gradle.org/m2/com/github/ben-manes/gradle-versions-plugin/0.51.0/gradle-versions-plugin-0.51.0.module
# 轉換後(新增 gradle 前綴)
https://xget.xi-xu.me/gradle/m2/com/github/ben-manes/gradle-versions-plugin/0.51.0/gradle-versions-plugin-0.51.0.module
```
#### Homebrew
```url
# Homebrew 公式儲存庫原始 URL
https://github.com/Homebrew/homebrew-core/raw/HEAD/Formula/g/git.rb
# 轉換後(新增 homebrew 前綴)
https://xget.xi-xu.me/homebrew/homebrew-core/raw/HEAD/Formula/g/git.rb
# Homebrew API 原始 URL
https://formulae.brew.sh/api/formula/git.json
# 轉換後(新增 homebrew/api 前綴)
https://xget.xi-xu.me/homebrew/api/formula/git.json
# Homebrew Bottles 原始 URL
https://ghcr.io/v2/homebrew/core/git/manifests/2.39.0
# 轉換後(新增 homebrew/bottles 前綴)
https://xget.xi-xu.me/homebrew/bottles/v2/homebrew/core/git/manifests/2.39.0
```
#### RubyGems
```url
# RubyGems 軟體包檔案原始 URL
https://rubygems.org/gems/rails-7.0.4.gem
# 轉換後(新增 rubygems 前綴)
https://xget.xi-xu.me/rubygems/gems/rails-7.0.4.gem
# RubyGems API 原始 URL
https://rubygems.org/api/v1/gems/nokogiri.json
# 轉換後(新增 rubygems 前綴)
https://xget.xi-xu.me/rubygems/api/v1/gems/nokogiri.json
```
#### CRAN
```url
# CRAN 軟體包檔案原始 URL
https://cran.r-project.org/src/contrib/ggplot2_3.5.2.tar.gz
# 轉換後(新增 cran 前綴)
https://xget.xi-xu.me/cran/src/contrib/ggplot2_3.5.2.tar.gz
# CRAN 軟體包元資料原始 URL
https://cran.r-project.org/web/packages/dplyr/DESCRIPTION
# 轉換後(新增 cran 前綴)
https://xget.xi-xu.me/cran/web/packages/dplyr/DESCRIPTION
```
#### CPAN (Perl 軟體包管理)
```url
# CPAN 模組原始 URL
https://www.cpan.org/modules/by-module/DBI/DBI-1.643.tar.gz
# 轉換後(新增 cpan 前綴)
https://xget.xi-xu.me/cpan/modules/by-module/DBI/DBI-1.643.tar.gz
# CPAN 作者軟體包原始 URL
https://www.cpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz
# 轉換後(新增 cpan 前綴)
https://xget.xi-xu.me/cpan/authors/id/T/TI/TIMB/DBI-1.643.tar.gz
```
#### CTAN (TeX/LaTeX 軟體包管理)
```url
# CTAN 軟體包檔案原始 URL
https://tug.ctan.org/tex-archive/macros/latex/contrib/beamer.zip
# 轉換後(新增 ctan 前綴)
https://xget.xi-xu.me/ctan/tex-archive/macros/latex/contrib/beamer.zip
# CTAN 字體檔案原始 URL
https://tug.ctan.org/tex-archive/fonts/cm/pk/ljfour/public/cm/dpi600/cmr10.pk
# 轉換後(新增 ctan 前綴)
https://xget.xi-xu.me/ctan/tex-archive/fonts/cm/pk/ljfour/public/cm/dpi600/cmr10.pk
```
#### Go 模組
```url
# Go 模組代理原始 URL
https://proxy.golang.org/github.com/gin-gonic/gin/@v/v1.9.1.zip
# 轉換後(新增 golang 前綴)
https://xget.xi-xu.me/golang/github.com/gin-gonic/gin/@v/v1.9.1.zip
# Go 模組資訊原始 URL
https://proxy.golang.org/github.com/gorilla/mux/@v/list
# 轉換後(新增 golang 前綴)
https://xget.xi-xu.me/golang/github.com/gorilla/mux/@v/list
```
#### NuGet
```url
# NuGet 軟體包下載原始 URL
https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg
# 轉換後(新增 nuget 前綴)
https://xget.xi-xu.me/nuget/v3-flatcontainer/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg
# NuGet 軟體包元資料原始 URL
https://api.nuget.org/v3/registration5-semver1/microsoft.aspnetcore.app/index.json
# 轉換後(新增 nuget 前綴)
https://xget.xi-xu.me/nuget/v3/registration5-semver1/microsoft.aspnetcore.app/index.json
```
#### Rust Crates
```url
# Crate 下載原始 URL
https://crates.io/api/v1/crates/serde/1.0.0/download
# 轉換後(新增 crates 前綴)
https://xget.xi-xu.me/crates/serde/1.0.0/download
# Crate 元資料原始 URL
https://crates.io/api/v1/crates/serde
# 轉換後(新增 crates 前綴)
https://xget.xi-xu.me/crates/serde
# Crate 搜尋原始 URL
https://crates.io/api/v1/crates?q=serde
# 轉換後(新增 crates 前綴)
https://xget.xi-xu.me/crates/?q=serde
```
#### Packagist
```url
# Packagist 軟體包元資料原始 URL
https://repo.packagist.org/p2/symfony/console.json
# 轉換後(新增 packagist 前綴)
https://xget.xi-xu.me/packagist/p2/symfony/console.json
# Packagist 軟體包清單原始 URL
https://repo.packagist.org/packages/list.json
# 轉換後(新增 packagist 前綴)
https://xget.xi-xu.me/packagist/packages/list.json
```
#### Flathub
```url
# Flathub 儲存庫原始 URL
https://dl.flathub.org/repo/summary
# 轉換後(新增 flathub 前綴)
https://xget.xi-xu.me/flathub/repo/summary
# Flathub 應用程式引用原始 URL
https://dl.flathub.org/repo/appstream/org.gnome.gedit.flatpakref
# 轉換後(新增 flathub 前綴)
https://xget.xi-xu.me/flathub/repo/appstream/org.gnome.gedit.flatpakref
```
#### Linux 發行版
```url
# Debian 軟體包原始 URL
https://deb.debian.org/debian/pool/main/c/curl/curl_7.88.1-10+deb12u4_amd64.deb
# 轉換後(新增 debian 前綴)
https://xget.xi-xu.me/debian/debian/pool/main/c/curl/curl_7.88.1-10+deb12u4_amd64.deb
# Ubuntu 軟體包原始 URL
https://archive.ubuntu.com/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1.9_amd64.deb
# 轉換後(新增 ubuntu 前綴)
https://xget.xi-xu.me/ubuntu/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1.9_amd64.deb
# Fedora 軟體包原始 URL
https://dl.fedoraproject.org/pub/fedora/linux/releases/39/Everything/x86_64/os/Packages/n/nginx-1.24.0-1.fc39.x86_64.rpm
# 轉換後(新增 fedora 前綴)
https://xget.xi-xu.me/fedora/pub/fedora/linux/releases/39/Everything/x86_64/os/Packages/n/nginx-1.24.0-1.fc39.x86_64.rpm
# Rocky Linux 軟體包原始 URL
https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/b/bash-5.1.8-6.el9.x86_64.rpm
# 轉換後(新增 rocky 前綴)
https://xget.xi-xu.me/rocky/pub/rocky/9/BaseOS/x86_64/os/Packages/b/bash-5.1.8-6.el9.x86_64.rpm
# openSUSE 軟體包原始 URL
https://download.opensuse.org/distribution/leap/15.5/repo/oss/x86_64/vim-9.0.1572-150500.20.8.1.x86_64.rpm
# 轉換後(新增 opensuse 前綴)
https://xget.xi-xu.me/opensuse/distribution/leap/15.5/repo/oss/x86_64/vim-9.0.1572-150500.20.8.1.x86_64.rpm
# Arch Linux 軟體包原始 URL
https://geo.mirror.pkgbuild.com/core/os/x86_64/linux-6.6.10.arch1-1-x86_64.pkg.tar.zst
# 轉換後(新增 arch 前綴)
https://xget.xi-xu.me/arch/core/os/x86_64/linux-6.6.10.arch1-1-x86_64.pkg.tar.zst
```
#### arXiv
```url
# arXiv 論文 PDF 原始 URL
https://arxiv.org/pdf/2301.07041.pdf
# 轉換後(新增 arxiv 前綴)
https://xget.xi-xu.me/arxiv/pdf/2301.07041.pdf
# arXiv 論文原始碼原始 URL
https://arxiv.org/e-print/2301.07041
# 轉換後(新增 arxiv 前綴)
https://xget.xi-xu.me/arxiv/e-print/2301.07041
```
#### F-Droid
```url
# F-Droid 應用程式 APK 原始 URL
https://f-droid.org/repo/org.fdroid.fdroid_1016050.apk
# 轉換後(新增 fdroid 前綴)
https://xget.xi-xu.me/fdroid/repo/org.fdroid.fdroid_1016050.apk
# F-Droid 應用程式元資料原始 URL
https://f-droid.org/api/v1/packages/org.fdroid.fdroid
# 轉換後(新增 fdroid 前綴)
https://xget.xi-xu.me/fdroid/api/v1/packages/org.fdroid.fdroid
```
#### Jenkins 外掛程式
```url
# Jenkins 更新中心原始 URL
https://updates.jenkins.io/update-center.json
# 轉換後(新增 jenkins 前綴)
https://xget.xi-xu.me/jenkins/update-center.json
# Jenkins 外掛程式下載原始 URL
https://updates.jenkins.io/download/plugins/maven-plugin/3.27/maven-plugin.hpi
# 轉換後(新增 jenkins 前綴)
https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi
```
#### 容器註冊表
Xget 支援多個容器註冊表,使用 `cr/[容器註冊表前綴]` 格式:
| 容器註冊表 | 容器註冊表前綴 | 原始 URL 格式 | 加速 URL 格式 |
| -------------------- | -------------- | ------------------------------------------- | ------------------------------------------- |
| Docker Hub | `docker` | `https://registry-1.docker.io/...` | `https://xget.xi-xu.me/cr/docker/...` |
| Quay.io | `quay` | `https://quay.io/...` | `https://xget.xi-xu.me/cr/quay/...` |
| Google 容器註冊表 | `gcr` | `https://gcr.io/...` | `https://xget.xi-xu.me/cr/gcr/...` |
| Microsoft 容器註冊表 | `mcr` | `https://mcr.microsoft.com/...` | `https://xget.xi-xu.me/cr/mcr/...` |
| Amazon Public ECR | `ecr` | `https://public.ecr.aws/...` | `https://xget.xi-xu.me/cr/ecr/...` |
| GitHub 容器註冊表 | `ghcr` | `https://ghcr.io/...` | `https://xget.xi-xu.me/cr/ghcr/...` |
| GitLab 容器註冊表 | `gitlab` | `https://registry.gitlab.com/...` | `https://xget.xi-xu.me/cr/gitlab/...` |
| Red Hat 註冊表 | `redhat` | `https://registry.redhat.io/...` | `https://xget.xi-xu.me/cr/redhat/...` |
| Oracle 容器註冊表 | `oracle` | `https://container-registry.oracle.com/...` | `https://xget.xi-xu.me/cr/oracle/...` |
| Cloudsmith | `cloudsmith` | `https://docker.cloudsmith.io/...` | `https://xget.xi-xu.me/cr/cloudsmith/...` |
| DigitalOcean 註冊表 | `digitalocean` | `https://registry.digitalocean.com/...` | `https://xget.xi-xu.me/cr/digitalocean/...` |
| VMware 註冊表 | `vmware` | `https://projects.registry.vmware.com/...` | `https://xget.xi-xu.me/cr/vmware/...` |
| Kubernetes 註冊表 | `k8s` | `https://registry.k8s.io/...` | `https://xget.xi-xu.me/cr/k8s/...` |
| Heroku 註冊表 | `heroku` | `https://registry.heroku.com/...` | `https://xget.xi-xu.me/cr/heroku/...` |
| SUSE 註冊表 | `suse` | `https://registry.suse.com/...` | `https://xget.xi-xu.me/cr/suse/...` |
| openSUSE 註冊表 | `opensuse` | `https://registry.opensuse.org/...` | `https://xget.xi-xu.me/cr/opensuse/...` |
| Gitpod 註冊表 | `gitpod` | `https://registry.gitpod.io/...` | `https://xget.xi-xu.me/cr/gitpod/...` |
```url
# Docker Hub 原始 URL(官方鏡像)
https://registry-1.docker.io/v2/library/nginx/manifests/latest
# 轉換後(新增 cr/docker 前綴)
https://xget.xi-xu.me/cr/docker/v2/nginx/manifests/latest
# Docker Hub 原始 URL(使用者鏡像)
https://registry-1.docker.io/v2/nginxinc/nginx-unprivileged/manifests/latest
# 轉換後(新增 cr/docker 前綴)
https://xget.xi-xu.me/cr/docker/v2/nginxinc/nginx-unprivileged/manifests/latest
# GitHub 容器註冊表原始 URL
https://ghcr.io/v2/nginxinc/nginx-unprivileged/manifests/latest
# 轉換後(新增 cr/ghcr 前綴)
https://xget.xi-xu.me/cr/ghcr/v2/nginxinc/nginx-unprivileged/manifests/latest
# Google 容器註冊表原始 URL
https://gcr.io/v2/distroless/base/manifests/latest
# 轉換後(新增 cr/gcr 前綴)
https://xget.xi-xu.me/cr/gcr/v2/distroless/base/manifests/latest
```
應用場景見[容器鏡像加速](#容器鏡像加速)。
#### AI 推理供應商
Xget 支援眾多主流 AI 推理供應商的 API 加速,使用 `ip/[AI 推理供應商前綴]` 格式:
| AI 推理供應商 | AI 推理供應商前綴 | 原始 URL 格式 | 加速 URL 格式 |
| -------------- | ----------------- | ----------------------------------------------- | -------------------------------------------- |
| OpenAI | `openai` | `https://api.openai.com/...` | `https://xget.xi-xu.me/ip/openai/...` |
| Anthropic | `anthropic` | `https://api.anthropic.com/...` | `https://xget.xi-xu.me/ip/anthropic/...` |
| Gemini | `gemini` | `https://generativelanguage.googleapis.com/...` | `https://xget.xi-xu.me/ip/gemini/...` |
| Vertex AI | `vertexai` | `https://aiplatform.googleapis.com/...` | `https://xget.xi-xu.me/ip/vertexai/...` |
| Cohere | `cohere` | `https://api.cohere.ai/...` | `https://xget.xi-xu.me/ip/cohere/...` |
| Mistral AI | `mistralai` | `https://api.mistral.ai/...` | `https://xget.xi-xu.me/ip/mistralai/...` |
| xAI | `xai` | `https://api.x.ai/...` | `https://xget.xi-xu.me/ip/xai/...` |
| GitHub Models | `githubmodels` | `https://models.github.ai/...` | `https://xget.xi-xu.me/ip/githubmodels/...` |
| NVIDIA API | `nvidiaapi` | `https://integrate.api.nvidia.com/...` | `https://xget.xi-xu.me/ip/nvidiaapi/...` |
| Perplexity | `perplexity` | `https://api.perplexity.ai/...` | `https://xget.xi-xu.me/ip/perplexity/...` |
| Groq | `groq` | `https://api.groq.com/...` | `https://xget.xi-xu.me/ip/groq/...` |
| Cerebras | `cerebras` | `https://api.cerebras.ai/...` | `https://xget.xi-xu.me/ip/cerebras/...` |
| SambaNova | `sambanova` | `https://api.sambanova.ai/...` | `https://xget.xi-xu.me/ip/sambanova/...` |
| Siray | `siray` | `https://api.siray.ai/...` | `https://xget.xi-xu.me/ip/siray/...` |
| HF Inference | `huggingface` | `https://router.huggingface.co/...` | `https://xget.xi-xu.me/ip/huggingface/...` |
| Together | `together` | `https://api.together.xyz/...` | `https://xget.xi-xu.me/ip/together/...` |
| Replicate | `replicate` | `https://api.replicate.com/...` | `https://xget.xi-xu.me/ip/replicate/...` |
| Fireworks | `fireworks` | `https://api.fireworks.ai/...` | `https://xget.xi-xu.me/ip/fireworks/...` |
| Nebius | `nebius` | `https://api.studio.nebius.ai/...` | `https://xget.xi-xu.me/ip/nebius/...` |
| Jina | `jina` | `https://api.jina.ai/...` | `https://xget.xi-xu.me/ip/jina/...` |
| Voyage AI | `voyageai` | `https://api.voyageai.com/...` | `https://xget.xi-xu.me/ip/voyageai/...` |
| Fal AI | `falai` | `https://fal.run/...` | `https://xget.xi-xu.me/ip/falai/...` |
| Novita | `novita` | `https://api.novita.ai/...` | `https://xget.xi-xu.me/ip/novita/...` |
| Burncloud | `burncloud` | `https://ai.burncloud.com/...` | `https://xget.xi-xu.me/ip/burncloud/...` |
| OpenRouter | `openrouter` | `https://openrouter.ai/...` | `https://xget.xi-xu.me/ip/openrouter/...` |
| Poe | `poe` | `https://api.poe.com/...` | `https://xget.xi-xu.me/ip/poe/...` |
| Featherless AI | `featherlessai` | `https://api.featherless.ai/...` | `https://xget.xi-xu.me/ip/featherlessai/...` |
| Hyperbolic | `hyperbolic` | `https://api.hyperbolic.xyz/...` | `https://xget.xi-xu.me/ip/hyperbolic/...` |
```url
# OpenAI API 原始 URL
https://api.openai.com/v1/chat/completions
# 轉換後(新增 ip/openai 前綴)
https://xget.xi-xu.me/ip/openai/v1/chat/completions
# Claude API 原始 URL
https://api.anthropic.com/v1/messages
# 轉換後(新增 ip/anthropic 前綴)
https://xget.xi-xu.me/ip/anthropic/v1/messages
# Gemini API 原始 URL
https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
# 轉換後(新增 ip/gemini 前綴)
https://xget.xi-xu.me/ip/gemini/v1beta/models/gemini-2.5-flash:generateContent
# HF Inference API 原始 URL
https://router.huggingface.co/hf-inference/models/openai/whisper-large-v3
# 轉換後(新增 ip/huggingface 前綴)
https://xget.xi-xu.me/ip/huggingface/hf-inference/models/openai/whisper-large-v3
```
應用場景見 [AI 推理 API 加速](#ai-推理-api-加速)。
## 🎯 應用場景
### Git 操作與配置
#### Git 操作
```bash
# 克隆儲存庫
git clone https://xget.xi-xu.me/gh/microsoft/vscode.git
# 克隆指定分支
git clone -b main https://xget.xi-xu.me/gh/facebook/react.git
# 淺克隆(僅最新提交)
git clone --depth 1 https://xget.xi-xu.me/gh/torvalds/linux.git
# 克隆 GitLab 儲存庫
git clone https://xget.xi-xu.me/gl/gitlab-org/gitlab.git
# 克隆 Gitea 儲存庫
git clone https://xget.xi-xu.me/gitea/gitea/gitea.git
# 克隆 Codeberg 儲存庫
git clone https://xget.xi-xu.me/codeberg/forgejo/forgejo.git
# 克隆 SourceForge 儲存庫
git clone https://xget.xi-xu.me/sf/projects/mingw-w64/code.git
# 克隆 AOSP 儲存庫
git clone https://xget.xi-xu.me/aosp/platform/frameworks/base.git
# 新增遠端儲存庫
git remote add upstream https://xget.xi-xu.me/gh/[擁有者]/[儲存庫].git
# 拉取更新
git pull https://xget.xi-xu.me/gh/microsoft/vscode.git main
# 子模組遞迴克隆
git clone --recursive https://xget.xi-xu.me/gh/[使用者名稱]/[帶子模組的儲存庫].git
```
#### Git 全域加速配置
```bash
# 為特定網域配置 Git 使用 Xget
git config --global url."https://xget.xi-xu.me/gh/".insteadOf "https://github.com/"
git config --global url."https://xget.xi-xu.me/gl/".insteadOf "https://gitlab.com/"
git config --global url."https://xget.xi-xu.me/gitea/".insteadOf "https://gitea.com/"
git config --global url."https://xget.xi-xu.me/codeberg/".insteadOf "https://codeberg.org/"
git config --global url."https://xget.xi-xu.me/sf/".insteadOf "https://sourceforge.net/"
git config --global url."https://xget.xi-xu.me/aosp/".insteadOf "https://android.googlesource.com/"
# 驗證配置
git config --global --get-regexp url
# 現在所有相關平台的 git clone 都會自動使用 Xget
git clone https://github.com/microsoft/vscode.git # 自動轉換為 Xget URL
git clone https://gitlab.com/gitlab-org/gitlab.git # 自動轉換為 Xget URL
git clone https://codeberg.org/forgejo/forgejo.git # 自動轉換為 Xget URL
git clone https://android.googlesource.com/platform/frameworks/base.git # 自動轉換為 Xget URL
```
### 主流下載工具整合
#### wget 下載
```bash
# 下載單一檔案
wget https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip
# 斷點續傳
wget -c https://xget.xi-xu.me/hf/microsoft/DialoGPT-large/resolve/main/pytorch_model.bin
# 批次下載
wget -i urls.txt # urls.txt 包含多個 Xget URL
```
#### cURL 下載
```bash
# 基本下載
curl -L -O https://xget.xi-xu.me/gh/golang/go/archive/refs/tags/go1.22.0.tar.gz
# 顯示進度列
curl -L --progress-bar -o model.bin https://xget.xi-xu.me/hf/openai/whisper-large-v3/resolve/main/pytorch_model.bin
# 設定 User-Agent
curl -L -H "User-Agent: MyApp/1.0" https://xget.xi-xu.me/gl/gitlab-org/gitlab-runner/-/archive/main/gitlab-runner-main.zip
```
#### aria2 多執行緒下載
```bash
# 多執行緒下載大檔案
aria2c -x 16 -s 16 https://xget.xi-xu.me/hf/microsoft/DialoGPT-large/resolve/main/pytorch_model.bin
# 斷點續傳
aria2c -c https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip
# 批次下載設定檔
aria2c -i download-list.txt # 包含多個 Xget URL 的檔案
```
### Hugging Face 鏡像
```python
import os
from transformers import AutoTokenizer, AutoModelForCausalLM
# 設定環境變數,讓 transformers 庫自動使用 Xget 鏡像
os.environ['HF_ENDPOINT'] = 'https://xget.xi-xu.me/hf'
# 定義模型名稱
model_name = 'microsoft/DialoGPT-medium'
print(f"正在從鏡像下載模型: {model_name}")
# 使用 AutoModelForCausalLM 來載入對話生成模型
# 由於上面設定了環境變數,這裡無需新增任何額外參數
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
print("模型和分詞器載入成功!")
# 您現在可以使用 tokenizer 和 model 了
# 例如:
# new_user_input_ids = tokenizer.encode("Hello, how are you?", return_tensors='pt')
# chat_history_ids = model.generate(new_user_input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id)
# print(tokenizer.decode(chat_history_ids[:, new_user_input_ids.shape[-1]:][0], skip_special_tokens=True))
```
### Civitai AI 模型平台
```python
import requests
# 設定 API 基礎 URL 使用 Xget
base_url = "https://xget.xi-xu.me/civitai"
# 獲取模型資訊
def get_model_info(model_id):
"""獲取 Civitai 模型資訊"""
url = f"{base_url}/api/v1/models/{model_id}"
response = requests.get(url)
return response.json()
# 下載模型
def download_model(model_version_id, output_path):
"""下載 Civitai 模型檔案"""
download_url = f"{base_url}/api/download/models/{model_version_id}"
print(f"正在下載模型版本 {model_version_id}...")
response = requests.get(download_url, stream=True)
response.raise_for_status()
with open(output_path, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
print(f"模型已下載到: {output_path}")
# 使用範例
model_id = 7240 # 範例模型 ID
model_info = get_model_info(model_id)
print(f"模型名稱: {model_info['name']}")
# 下載第一個模型版本
if model_info['modelVersions']:
version_id = model_info['modelVersions'][0]['id']
download_model(version_id, f"model_{version_id}.safetensors")
```
### npm 軟體包管理加速
#### 配置 npm 使用 Xget 鏡像
```bash
# 臨時使用 Xget 鏡像
npm install --registry https://xget.xi-xu.me/npm/
# 全域配置 npm 鏡像
npm config set registry https://xget.xi-xu.me/npm/
# 驗證配置
npm config get registry
```
#### 配置 Bun 使用 Xget 鏡像
```toml
# bunfig.toml(專案級)或 ~/.bunfig.toml(全域)
[install]
registry = "https://xget.xi-xu.me/npm/"
```
```bash
# 使用 Bun 安裝依賴項
bun install
# Bun 也支援 .npmrc,可直接重用既有的 npm 鏡像配置
echo "registry=https://xget.xi-xu.me/npm/" > .npmrc
bun install
```
#### 在專案中使用(npm / Bun)
```bash
# 在 .npmrc 檔案中配置專案級鏡像(npm / Bun 可重用)
echo "registry=https://xget.xi-xu.me/npm/" > .npmrc
# 使用 npm 安裝依賴項
npm install
# 使用 Bun 安裝依賴項
bun install
```
### Python 軟體包管理加速
#### 配置 pip 使用 Xget 鏡像
```bash
# 臨時使用 Xget 鏡像
pip install requests -i https://xget.xi-xu.me/pypi/simple/
# 全域配置 pip 鏡像
pip config set global.index-url https://xget.xi-xu.me/pypi/simple/
pip config set global.trusted-host xget.xi-xu.me
# 驗證配置
pip config list
```
#### 在專案中使用
```bash
# 建立 pip.conf 檔案(Linux/macOS)
mkdir -p ~/.pip
cat > ~/.pip/pip.conf << EOF
[global]
index-url = https://xget.xi-xu.me/pypi/simple/
trusted-host = xget.xi-xu.me
EOF
# 或在專案根目錄建立 pip.conf
cat > pip.conf << EOF
[global]
index-url = https://xget.xi-xu.me/pypi/simple/
trusted-host = xget.xi-xu.me
EOF
# 使用設定檔安裝
pip install -r requirements.txt --config-file pip.conf
```
#### 在 requirements.txt 中指定鏡像
```txt
# requirements.txt
--index-url https://xget.xi-xu.me/pypi/simple/
--trusted-host xget.xi-xu.me
requests>=2.25.0
numpy>=1.21.0
pandas>=1.3.0
matplotlib>=3.4.0
```
### conda 軟體包管理加速
#### 配置 conda 使用 Xget 鏡像
```bash
# 配置預設頻道鏡像
conda config --add default_channels https://xget.xi-xu.me/conda/pkgs/msys2
conda config --add default_channels https://xget.xi-xu.me/conda/pkgs/r
conda config --add default_channels https://xget.xi-xu.me/conda/pkgs/main
# 配置所有社群頻道鏡像(推薦)
conda config --set channel_alias https://xget.xi-xu.me/conda/community
# 或配置特定社群頻道
conda config --add channels https://xget.xi-xu.me/conda/community/conda-forge
conda config --add channels https://xget.xi-xu.me/conda/community/bioconda
# 設定頻道優先順序
conda config --set channel_priority strict
# 驗證配置
conda config --show
```
#### 在 .condarc 中配置
.condarc 檔案可以放在使用者主目錄(`~/.condarc`)或專案根目錄下:
```yaml
default_channels:
- https://xget.xi-xu.me/conda/pkgs/main
- https://xget.xi-xu.me/conda/pkgs/r
- https://xget.xi-xu.me/conda/pkgs/msys2
channel_alias: https://xget.xi-xu.me/conda/community
channel_priority: strict
show_channel_urls: true
```
#### 使用環境檔案
環境檔案中可以直接指定完整的鏡像 URL:
```yaml
# environment.yml
name: myproject
channels:
- https://xget.xi-xu.me/conda/pkgs/main
- https://xget.xi-xu.me/conda/pkgs/r
- https://xget.xi-xu.me/conda/community/bioconda
- https://xget.xi-xu.me/conda/community/conda-forge
dependencies:
- python=3.11
- numpy>=1.24.0
- pandas>=2.0.0
- matplotlib>=3.7.0
- scipy>=1.10.0
- pip
- pip:
- requests>=2.28.0
```
```bash
# 使用環境檔案建立環境
conda env create -f environment.yml
# 更新環境
conda env update -f environment.yml
```
### Maven 軟體包管理加速
#### 配置 Maven 使用 Xget 鏡像
```xml