1. 安装 Xray#
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --beta
2. 下载配置#
VLESS-XTLS-uTLS-REALITY
curl -Lo /usr/local/etc/xray/config.json https://raw.githubusercontent.com/chika0801/Xray-examples/main/VLESS-XTLS-uTLS-REALITY/config_server.json
3. 启动程序#
systemctl restart xray && sleep 0.2 && systemctl status xray
4. 配置示例#
服务端配置示例#
{
"log": {
"loglevel": "warning"
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "block"
}
]
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "chika", // 执行 xray uuid 生成,或 1-30 字节的字符串
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false, // 若为 true,输出调试信息
"dest": "itunes.apple.com:443", // 目标网站最低标准:国外网站,支持 TLSv1.3、X25519 与 H2,域名非跳转用(主域名可能被用于跳转到 www)
"xver": 0,
"serverNames": [ // 客户端可用的 serverName 列表,暂不支持 * 通配符
"itunes.apple.com", // 执行 xray tls ping www.lovelive-anime.jp,显示 Pinging with SNI, handshake succeeded, Allowed domains:***,填 Allowed domains 的值
],
"privateKey": "2KZ4uouMKgI8nR-LDJNP1_MHisCJOmKGj9jUjZLncVU", // 执行 xray x25519 生成,填 "Private key" 的值
"shortIds": [ // 客户端可用的 shortId 列表,可用于区分不同的客户端
"", // 若有此项,客户端 shortId 可为空
"a1", // 0 到 f,长度为 2 的倍数,长度上限为 16,或执行 openssl rand -hex 8 生成
"bc19",
"b2da06",
"2d940fe6",
"b85e293fa1",
"4a9f72b5c803",
"19f70b462cea5d",
"6ba85179e30d4fc2"
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
}
],
"policy": {
"levels": {
"0": {
"handshake": 2,
"connIdle": 120
}
}
}
}
客户端配置示例(以 Clash.Meta 为例)#
- {name: VLess.XTLS.uTLS.Reality, server: server_ip or domain, port: 443, type: vless, uuid: same as above, tls: true, udp: true, flow: xtls-rprx-vision, servername: itunes.apple.com, reality-opts: {public-key: YyZo1wIsp71MAi-wyrCfQjYF72Rbs5CdDPtsD1OhBnM}, client-fingerprint: chrome}
public-key 填写上面执行过 xray x255519 后生成的 “Public Key” 值;client-fingerprint 可填:chrome
、firefox
、safari
、random