SSR 支持背景
我曾与朋友合购 Surge for Mac。购入后发现 Surge 原生不支持 SSR,必须依赖 External Proxy Provider 扩展才能接入,因此转向研究 V2Ray 支持方案。
V2Ray 支持与订阅脚本
我查阅资料时参考了这篇关于 Surge Mac 配置 V2Ray 的博客,确认 3.3.1 beta 版本起已内置 VMess 支持,随即升级了客户端。
同时我编写了一个将 V2Ray 订阅转换为 Surge 配置的 Gist 脚本,用于兼容 npsboost 与 wdnmd.network 等机场提供的订阅格式。
Surge for Mac 的 VMess 协议配置说明
当时版本仅支持 chacha20-poly1305 加密算法,配置示例如下:
vmess-proxy = vmess, example.com, 443, username = 12345678-abcd-1234-1234-47ffca0ce229, ws=true, tls=true, ws-path=/v2, ws-headers=X-Header-1:value|X-Header-2:value
官方更新说明原文如下:
Supports VMess proxy protocol. All proxy options for TLS proxy are available. Please note that if you use the ‘Host’ header to override the default header, you may need to override the ‘Origin’ header to get rid of the 403 error. Web-socket and TLS options would degrade performance. Only enable when necessary. Surge only supports chacha20-poly1305 encryption algorithm. Please make sure the server supports it. We have no plan to implement other ciphers. Snell and shadowsocks are still the most recommended protocols.