bash
# 添加开启代理的快捷命令
echo 'alias setproxy="export http_proxy=http://127.0.0.1:12334; export https_proxy=http://127.0.0.1:12334; export all_proxy=socks5://127.0.0.1:12334; echo \"✅ 本地代理已开启\""' >> ~/.bashrc
# 顺便添加一个关闭代理的快捷命令,方便切换
echo 'alias unsetproxy="unset http_proxy https_proxy all_proxy; echo \"❌ 本地代理已关闭\""' >> ~/.bashrc
远端服务器共享本地代理配置指南通过 SSH 的 RemoteForward 功能,我们可以将远端服务器的网络请求通过 SSH 隧道传回本地,并交由本地的 Hiddify 代理进行处理。第一步:修改本地 SSH 配置文件在你本地的 Linux 电脑上,打开你的 SSH 配置文件(通常是 ~/.ssh/config),在原有的配置基础上添加一行 RemoteForward 配置:
bash
Host node04
HostName 10.14.129.184
User lynn
Port 3622
ForwardX11 yes
ForwardX11Trusted no
# 新增下面这一行,将服务器的 12334 端口转发到本地的 12334 端口
RemoteForward 12334 127.0.0.1:12334
或者测试 Claude 的 API 端点
curl -I https://api.anthropic.com
当你需要运行 Claude Code 或者拉取 Github 代码时,直接输入:
bash
setproxy
当你需要恢复正常的无代理网络时,输入:
bash
unsetproxy