代理
Windows下的CMD
set HTTP_PROXY=http://127.0.0.1:1080
set HTTPS_PROXY=http://127.0.0.1:1080
Clash
set http_proxy=http://127.0.0.1:7890
set https_proxy=http://127.0.0.1:7890
Clash Verge
set http_proxy=http://127.0.0.1:7897
set https_proxy=http://127.0.0.1:7897
检验
curl ip.gs
curl www.google.com
Linux下Terminal
查询当前终端代理
env | grep -i proxy
设置
export http_proxy=http://127.0.0.1:12333
export https_proxy=http://127.0.0.1:12333
export no_proxy=localhost,127.0.0.0/8,::1
export NO_PROXY=localhost,127.0.0.0/8,::1
unset https_proxy
unset http_proxy
ubuntu 使用clash
- 下载 clash for windows,选择 linux 版本
- 找到下载文件,执行如下命令
# 进入下载目录(默认情况是下载到 ~/Downloads 目录,如果不是请进入到对应的下载目录)
cd ~/Downloads
# 解压
tar -zxvf Clash.for.Windows-0.20.39-x64-linux.tar.gz
# 重命名
mv Clash.for.Windows-0.20.39-x64-linux clash
# 进入clash目录
cd clash
# 执行cfw命令,即可打开clash界面
./cfw
- 设置系统网络代理模式
- 127.0.0.1 7890
- localhost, 127.0.0.0/8, ::1
- 创建clash应用程序
# 进入用户应用程序目录
cd ~/.local/share/applications
# 创建clash应用程序
touch clash.desktop
# 将以下代码粘贴到 clash.desktop 文件(Icon是应用程序图标,将下载的图标 clash.png 放到 ~/Documents 目录下面)
[Desktop Entry]
Name=clash for windows
Icon=~/Downloads/clash.png
Exec=~/Downloads/clash/cfw
Type=Application
Terminal=true
Categories=Application;
# 添加可执行权限
chmod +x clash.desktop
yarn(CMD中)
set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
set ELECTRON_CUSTOM_DIR={{ version }}
proxt.bat on
REM set ELECTRON_GET_USE_PROXY=true
# 验证
echo %ELECTRON_MIRROR%
yarn install
最后编辑于:2025 年 03 月 27 日 01:09