方案:部署 Xray (VLESS + Reality) —— 强烈推荐
特点:无需购买域名,无需 SSL 证书,自动伪装成访问微软/谷歌等正规网站,抗封锁能力极强。
1. 一键安装 Xray
使用官方安装脚本:
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
2. 生成 Reality 配置
Reality 协议需要指定一个“伪装网站”(目标网站)。我们选择一个稳定的大站(如 www.microsoft.com 或 www.apple.com)。
首先获取服务器公钥和私钥,并确定监听端口(例如 443 或 8443):
# 生成密钥对
xray x25519
输出示例:Private key: uZ...Public key: dP...
请记下这两个值。
3. 修改配置文件
编辑 /usr/local/etc/xray/config.json。
为了方便,你可以直接覆盖以下内容(请替换 <Your_Public_Key> 和 <Your_Private_Key> 为上一步生成的值):
{
"inbounds": [
{
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "a5b6c7d8-e9f0-1234-5678-90abcdef1234",
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false,
"dest": "www.microsoft.com:443",
"xver": 0,
"serverNames": [
"www.microsoft.com"
],
"privateKey": "<Your_Private_Key>",
"shortIds": [
""
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
],
"log": {
"loglevel": "warning"
}
}
注意:id 可以自行生成一个 UUID (命令: cat /proc/sys/kernel/random/uuid)。
4. 配置防火墙
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload
5. 重启 Xray
systemctl restart xray
systemctl status xray
6. 客户端连接信息
你需要将以下信息填入客户端(如 V2rayN, Clash Meta, Shadowrocket):
- 协议: VLESS
- 地址: 你的服务器 IP
- 端口: 443
- 用户 ID (UUID): 配置文件中设置的
id - 流控 (Flow):
xtls-rprx-vision - 传输层 (Network): TCP
- 安全 (Security): REALITY
- 公钥 (Public Key): 第一步生成的
Public key - ShortId: 留空或填配置中的 shortId
- SNI:
www.microsoft.com(需与配置一致)





