第三方学术加速服务指南
免责声明
本指南仅列出第三方提供的学术加速服务,用于在中国大陆加速访问 GitHub。我们不提供这些服务,也不对其可靠性负责。此列表并非详尽无遗。
ghgo.xyz
- 复制原始 github 仓库 clone 地址。
- 在地址前添加加速服务的域名
https://ghfast.top/
。
例如:
- 原地址:
https://github.com/redis/redis
- 代理地址:
https://ghfast.top/https://github.com/redis/redis
NOTE
以上加速服务的域名(ghgo.xyz)有可能因被封失效,您可以访问 https://ghproxy.link/ 获取最新可用域名。
下载公共仓库
获取 https 仓库地址后,添加前缀,发起 git clone:
git clone https://ghfast.top/https://github.com/redis/redis
下载私有仓库
下载私有仓库时,无法使用基于 SSH 密钥的认证,需要使用 Github 的访问 Token。步骤如下:
前往 GitHub,创建 Tokens(classic) 或 Fine-grained tokens。请务必确保您创建的 Token 对需要下载的仓库至少 Read-only 权限。
获取私有仓库的 https 仓库地址后,添加前缀,添加您的 Github 用户名和 Token,发起 git clone:
shellgit clone https://username:token@ghgo.xyz/https://github.com/redis/redis
gh-proxy.com
gh-proxy.com 仅用于 GitHub 加速。支持 git clone、wget、curl 等操作。
复制原始地址。
在地址前添加
https://gh-proxy.com/
。NOTE
不支持 SSH Key 方式 git clone 下载。
下载公共仓库示例:
# git clone
git clone https://gh-proxy.com/https://github.com/stilleshan/ServerStatus
GitHub 文件下载支持 raw.githubusercontent.com、gist.github.com、gist.githubusercontent.com,示例如下(wget
/curl
):
# wget
wget https://gh-proxy.com/https://github.com/stilleshan/ServerStatus/archive/master.zip
wget https://gh-proxy.com/https://raw.githubusercontent.com/stilleshan/ServerStatus/master/Dockerfile
# curl
curl -O https://gh-proxy.com/https://github.com/stilleshan/ServerStatus/archive/master.zip
curl -O https://gh-proxy.com/https://raw.githubusercontent.com/stilleshan/ServerStatus/master/Dockerfile
开发机 Clash 安装与配置教程
NOTE
如果您自行购买了相关服务,需要在 AIStudio 开发机上安装 Clash 客户端,可参考以下方法。
本教程将指导您在 Linux AMD64 开发机上安装和配置 Clash,使其能够作为 VPN 客户端使用。
准备工作
- SSH 访问权限: 确保您可以通过 SSH 远程连接到您的开发机。您需要具有
root
或具有sudo
权限的用户。
步骤 1 下载 Clash Premium 二进制文件
我们使用预编译的 Clash 二进制文件。如需从源码编译,可参考 Clash 文档。
使用
wget
命令从 Clash 下载页面 下载 Clash Premium 的 Linux AMD64 版本压缩包 (clash-linux-amd64-2023.08.17.gz
) 到开发机的/opt
目录。bashsudo wget https://downloads.clash.wiki/ClashPremium/clash-linux-amd64-2023.08.17.gz -P /opt
使用
gzip -d
命令解压缩下载的压缩包,得到 Clash 二进制文件clash-linux-amd64-2023.08.17
。bashsudo gzip -d /opt/clash-linux-amd64-2023.08.17.gz
使用
chmod +x
命令为 Clash 二进制文件添加可执行权限。bashsudo chmod +x /opt/clash-linux-amd64-2023.08.17
步骤 2 下载 GeoIP 数据库
Clash 需要 GeoIP 数据库文件 Country.mmdb
来进行地理位置判断。
尝试直接从 jsDelivr CDN 下载
Country.mmdb
文件到 Clash 配置目录。Clash 默认的配置目录为/root/.config/clash/
。bashsudo mkdir -p /root/.config/clash sudo wget https://cdn.jsdelivr.net/gh/Dreamacro/maxmind-geoip@release/Country.mmdb -P /root/.config/clash/
网络问题处理 (可选): 如果无法访问 jsDelivr (例如,被防火墙阻止),您可以先设法在本地下载
Country.mmdb
文件,然后通过scp
命令上传到开发机的/root/.config/clash/
目录。上传到开发机: 使用
scp
命令将本地下载的Country.mmdb
文件上传到开发机的/root/.config/clash/
目录。请替换以下命令中的/path/to/Country.mmdb
为您本地文件的实际路径,并确保 SSH 连接信息正确 (IP 地址111.51.90.14
和端口40124
来自开发机详情页)。bashscp -P 40124 /path/to/Country.mmdb root@111.51.90.14:/root/.config/clash/
步骤 3 创建 Clash 配置文件
config.yaml
为 Clash 配置文件,其中带有代理服务器地址、路由规则、Clash 服务端口、运行模式等关键配置。该配置需要从您的 Clash 订阅服务提供商获取。
Clash 首次启动时会自动尝试创建默认配置文件。默认配置
config.yaml
文件在/root/.config/clash/
目录。您可以先尝试启动一次,让 Clash 生成默认配置文件。bash/opt/clash-linux-amd64-2023.08.17 start
查看日志输出,如果看到类似
[Config] can't find config, create a initial config file path=/root/.config/clash/config.yaml
的信息,则表示默认配置文件已创建。编辑
config.yaml
文件以配置您的代理服务器信息。您可以直接上传配置文件,或使用vim
或nano
等文本编辑器打开并编辑/root/.config/clash/config.yaml
文件。bashvim /root/.config/clash/config.yaml
您需要在
config.yaml
文件中配置proxies
(代理服务器) 和rules
(规则) 部分。具体的配置请从您的 Clash 订阅服务提供商获取。一个简单的config.yaml
示例结构如下 (请根据您的实际情况修改):yamlport: 7890 socks-port: 7891 redir-port: 7892 allow-lan: false mode: Rule log-level: info external-controller: 127.0.0.1:9090 proxies: proxy-name: type: 类型 # 例如: ss, vmess, trojan server: 服务器地址 port: 端口 # ... 其他协议相关的参数,例如密码,加密方式等 proxy-groups: - name: "自动选择" type: select proxies: - proxy-name rules: - MATCH,自动选择
NOTE
配置说明及官方配置实例可参考 Clash Wiki。
步骤 4 启动 Clash
使用以下命令启动 Clash。为了让 Clash 在后台运行,建议使用
nohup
命令。bashnohup /opt/clash-linux-amd64-2023.08.17 start &
或者,您也可以直接在前台启动 Clash 以查看更详细的日志输出,方便调试:
bash/opt/clash-linux-amd64-2023.08.17 start
验证 Clash 是否工作
使用 curl
命令通过 Clash 代理访问 google.com
来验证 VPN 服务是否正常工作。 确保使用 --proxy http://127.0.0.1:7890
参数指定代理服务器地址。
curl --proxy http://127.0.0.1:7890 https://www.google.com
如果命令成功执行并返回 Google 首页的 HTML 代码,则表示 Clash 代理工作正常。
您还可以使用
-I
参数来检查 HTTP 状态码,HTTP/2 200
或HTTP/1.1 200 OK
表示请求成功。bashcurl -I --proxy http://127.0.0.1:7890 https://www.google.com
NOTE
- 请确保您的 Clash 配置文件 (
config.yaml
) 中的代理服务器信息正确有效。 - 如果遇到连接问题,请检查 Clash 日志 (通常在
/root/.config/clash/
目录下) 以获取更多错误信息。