硅谷服务器 SOCKS5 隧道 · 流量经 SSH 加密转发,出口显示为服务器 IP
三步连接:① 点上方按钮下载 start-proxy.bat → ② 双击运行(首次连接输 yes + 服务器密码;若弹出 SmartScreen 蓝色警告,点「更多信息 → 仍要运行」)→ ③ 窗口保持开启,代理即在线。之后每次连接只需双击脚本。
开启代理并让浏览器走 SOCKS5(见下方分应用配置)后,点击此按钮验证。
在自己电脑的 PowerShell / 终端执行:
ssh -D 127.0.0.1:1080 -N -T -o ServerAliveInterval=60 ubuntu@43.153.53.238
yes 确认指纹,然后输入服务器密码(建议配置密钥免密登录)。设置 → 网络设置 → 手动配置代理:SOCKS 主机 127.0.0.1、端口 1080、选择 SOCKS v5,并勾选「使用 SOCKS v5 代理解析 DNS」。
git config --global http.proxy socks5h://127.0.0.1:1080
git config --global https.proxy socks5h://127.0.0.1:1080
# 取消代理:
git config --global --unset http.proxy
git config --global --unset https.proxy
export ALL_PROXY=socks5h://127.0.0.1:1080
仅当前终端有效:curl、Git 及支持代理的开发工具走硅谷出口,微信、Steam、国内网页不受影响。
# 方式一:环境变量(对整个 shell 生效)
export HTTP_PROXY=socks5h://127.0.0.1:1080
export HTTPS_PROXY=socks5h://127.0.0.1:1080
# 方式二:requests 单独指定
proxies = {"http": "socks5h://127.0.0.1:1080", "https": "socks5h://127.0.0.1:1080"}
requests.get(url, proxies=proxies)
curl https://api.ipify.org # 本地出口 IP
curl --proxy socks5h://127.0.0.1:1080 https://api.ipify.org # 隧道出口 IP
start-proxy.bat(上方按钮可下载;源文件在服务器 projects/VPN/,另有 PowerShell 版与 ssh config 免记命令示例)ssh-keygen 生成后把公钥写入服务器 ~/.ssh/authorized_keys),免密码更安全noindex 阻止搜索引擎收录