Linux 上使用 Clash Core

Linux 上使用 Clash Core

注意 这是可以在纯终端使用的ClashCore 而非有界面的Clash for Windows GUI

免责声明

本文章不提供任何翻墙、VPN、机场等,只是方便各位程序员拉取Github仓库加速,方便学习、研究。

下载 Clash

# 首先下载wget 
# Centos: yum install wget 
# 或者 Ubuntu: apt install wget
wget https://cdn1.d5v.cc/CDN/Project/package/clash/latest/linux/cls

增加执行权限

chmod +x ./cls

首次运行初始化

./cls
INFO[0000] Can't find config, create a initial config file 
INFO[0000] 没有找到 MMDB, 开始下载...                       
INFO[0000] inbound mixed://127.0.0.1:7890 created successfully

Ctrl + C 结束 第一次运行只是让他初始化

下载配置链接

curl https://<你的配置链接> -o /root/.config/clash/config.yaml

测试启动

成功你应该看到以下日志

./cls
INFO[0000] Start initial compatible provider 故障转移   
INFO[0000] Start initial compatible provider 自动选择   
INFO[0000] Start initial compatible provider <************>
INFO[0000] inbound mixed://:7890 created successfully
INFO[0000] RESTful API listening at: 127.0.0.1:9090

Ctrl + C 结束

持久化运行

# 下载 screen 如果你不知道是干什么的 建议Bing
yum install screen

# 创建一个screen
screen -R clash

# 启动 
./cls

# 启动后按 Ctrl + A + D 将screen存入后台运行
# 当你要回到这个窗口 使用 screen -r clash 即可
# 当你想结束clash 先进入screen 然后按Ctrl + C 并输入 exit 就可以了

设置为系统代理

export https_proxy=http://127.0.0.1:7890/
export http_proxy=http://127.0.0.1:7890/

(拓展) 设置Git代理

git config --global http.proxy 127.0.0.1:7890 --replace-all 
git config --global https.proxy 127.0.0.1:7890

测试

[root@71cf3b987028 /]# git clone https://github.com/*******/*******.git
Cloning into '******'...
remote: Enumerating objects: 210, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 210 (delta 4), reused 4 (delta 4), pack-reused 201
Receiving objects: 100% (210/210), 54.63 KiB | 0 bytes/s, done.
Resolving deltas: 100% (95/95), done.

可见下载速度是非常快啊

LICENSED UNDER CC BY-NC-SA 4.0
Comment