协议选择:VLESS + Vision + REALITY
REALITY 借用别人的合规证书(如微软、索尼),你不需要自己花钱买域名、更不用折腾配置证书自动续期。
Vision 流控可以实现“流式过滤”,遇到本来就加密的 HTTPS 流量直接放行(Splice 技术),不占用 VPS 的 CPU 去二次加密,延迟极低,看 4K/8K 视频和下载非常爽。
xtls-rprx-vision: 拥有独创的流式控制机制。它能智能识别出流量中原本就已经加密过的部分(比如你正在浏览一个 HTTPS 网站,流量本身就是加密的),然后直接放行,不再重复加密。这样既隐藏了代理特征,又保证了接近原生的跑满带宽速度,延迟极低。
自建 Vless+vision+Reality 一键部署脚本
Vless+vision+Reality 协议一键部署脚本(Alpine)
bash <(wget -qO- https://raw.githubusercontent.com/xhpx7301/vvr/main/install-xray-reality-alpine.sh)Vless+vision+Reality 协议一键部署脚本(Alpine-64MB版本)
bash <(wget -qO- https://raw.githubusercontent.com/xhpx7301/vvr/main/install-xray-reality-alpine-64mb.sh)Vless+vision+Reality 协议一键部署脚本(Debian)
sh -c "$(wget -qO- https://raw.githubusercontent.com/xhpx7301/vvr/main/install-xray-reality-debian.sh)"Sing-box 多协议一键部署脚本
bash -c "$(curl -fsSL https://raw.githubusercontent.com/caigouzi121380/singbox-deploy/main/install-singbox-yyds.sh)"手动搭建(Alpine)
一、系统环境准备
确认系统架构
uname -m| 输出 | 架构 |
|---|---|
| x86_64 | AMD64 |
| aarch64 | ARM64 |
| armv7l | ARMv7/ |
二、安装必要工具
安装 sudo 和 bash :
apk update && apk add sudo bashAlpine 安装基础工具( bash sudo curl wget nano htop unzip git ):
apk update && apk add bash sudo curl wget nano htop unzip git安装网络管理工具包 iproute2(遇到错误-ash: ss: not found)
apk add iproute2三、下载 Xray
1.进入临时目录:
2.1下载最新版(ARM64):
wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-arm64-v8a.zip2.2下载最新版(AMD64):
wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip3.1解压(ARM64):
unzip Xray-linux-arm64-v8a.zip3.2解压(AMD64):
unzip Xray-linux-64.zip4.创建目录:
mkdir -p /usr/local/xray将当前目录下的 xray 文件复制到 /usr/local/xray/ 文件夹中(无效则先进入文件夹再执行,使用下面的方法)
cp xray /usr/local/xray/进入Xray-linux-arm64-v8a文件夹后再执行上面的命令:
cd /root/Xray-linux-arm64-v8a四、生成 Reality 所需参数
1.赋予执行权限:
chmod +x /usr/local/xray/xray2.终端随机生成并打印一个标准的 UUID:
/usr/local/xray/xray uuid3.为 Xray 的 XTLS Vision / Reality 协议生成一对全新的加密密钥(包含一个私钥和一个公钥):
/usr/local/xray/xray x255194.利用 OpenSSL 工具生成并打印一串随机的、长度为 16 位的十六进制(Hex)字符串(用来进行客户端的临时身份验证,防止服务器被恶意探测)(shortId):
openssl rand -hex 85.选择伪装网站
www.sony.com五、Alpine 配置文件
1.创建目录:
mkdir -p /etc/xray2.创建配置:
nano /etc/xray/config.json3.填入:
{ "log": { "loglevel": "warning" }, "inbounds": [ { "port": 443, "protocol": "vless", "settings": { "clients": [ { "id": "你的UUID", "flow": "xtls-rprx-vision" } ], "decryption": "none" }, "streamSettings": { "network": "tcp", "security": "reality", "realitySettings": { "dest": "www.microsoft.com:443", "serverNames": [ "www.microsoft.com" ], "privateKey": "你的PrivateKey", "shortIds": [ "你的ShortID" ] } } } ], "outbounds": [ { "protocol": "freedom" } ] }4.测试配置
配置写好后先不要启动服务:
/usr/local/xray/xray run -test -config /etc/xray/config.json如果显示:“Configuration OK.”说明配置正确。
六、Alpine 开机启动(OpenRC)
1.创建服务文件:
nano /etc/init.d/xray2.填入内容:
#!/sbin/openrc-run
name="xray" command="/usr/local/xray/xray" command_args="run -config /etc/xray/config.json" pidfile="/run/xray.pid"
command_background="yes"3.赋予执行权限:
chmod +x /etc/init.d/xray4.加入开机启动:
rc-update add xray default5.启动:
rc-service xray start启动出现格式错误执行:
cat << 'EOF' > /etc/init.d/xray#!/sbin/openrc-run
name="xray"description="Xray Service"command="/usr/local/xray/xray"command_args="run -config /etc/xray/config.json"pidfile="/run/xray.pid"command_background="yes"
depend() { need net}EOF6.停止:
rc-service xray stop7.重启:
rc-service xray restart8.查看状态:
rc-service xray status查找Xray 进程
ps aux | grep xray查看全部监听端口
ss -tlnp通过使用假证书在 NAT 机器实现 3X-UI 面板安装与访问
3X-UI 面板安装
创建假证书:
mkdir -p /root/cert && openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /root/cert/private.key -out /root/cert/public.crt -subj “/C=CN/ST=GD/L=SZ/O=Acme/OU=Dev/CN=localhost”假证书文件位置:
公钥:
/root/cert/public.crt私钥
/root/cert/private.key*安装3x-ui面板:
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)通过搭建本地隧道实现 3X-UI 面板安装与访问
本地电脑运行:
ssh -L <本地端口>:127.0.0.1:<远程面板端口> <服务器用户名>@<服务器IP>
例:
ssh -L 54321:127.0.0.1:55555 root@178.157.58.201若 SSH 用非默认端口(如 2222),加 -p 2222:
ssh -fN -p 2222 -L <本地端口>:127.0.0.1:<远程面板端口> <服务器用户名>@<服务器IP>
例:
ssh -fN -p 2222 -L 54321:127.0.0.1:55555 root@178.157.58.201订阅链接转换
字段对照表
| 占位符 | JSON 配置路径 | 示例 |
|---|---|---|
{id} | settings.id | 443f6c38-05fc-4d93-a5d4-a34c2e569d16 |
{address} | settings.address | 193.227.109.23 |
{port} | settings.port | 21037 |
{network} | streamSettings.network | tcp |
{encryption} | settings.encryption | none |
{security} | streamSettings.security | reality |
{publicKey} | realitySettings.publicKey | n8CR7PcXBtxuq2t9ZjAe16cVvSihSZm61H9g-HgEkVI |
{fingerprint} | realitySettings.fingerprint | chrome |
{serverName} | realitySettings.serverName | www.apple.com |
{shortId} | realitySettings.shortId | 43fe9a |
{spiderX} | realitySettings.spiderX(需 URL 编码) | / → %2F |
{tag} | tag | vless-pvo159zu |
vless://________@________:____?type=____&encryption=____&security=____&pbk=________&fp=____&sni=________&sid=____&spx=____#________填写示例
vless://443f6c38-05fc-4d93-a5d4-a34c2e569d16@193.227.109.23:21037?type=tcp&encryption=none&security=reality&pbk=n8CR7PcXBtxuq2t9ZjAe16cVvSihSZm61H9g-HgEkVI&fp=chrome&sni=www.apple.com&sid=43fe9a&spx=%2F#vless-pvo159zu注意事项
-
spiderX为/时,链接里写%2F(URL 编码) -
flow为空时不需要加flow参数;若flow有值(如xtls-rprx-vision),在security后追加&flow=xtls-rprx-vision -
#后面是节点名称,直接填tag的值,无需编码
如果这篇文章对你有帮助,欢迎分享给更多人!
部分信息可能已经过时










