Xray, VLESS_Reality模式 极简一键脚本
这个一键脚本超级简单。有效语句8行(其中BBR 5行, 安装Xray 1行, 生成x25519公私钥 1行,生成UUID 1行)+Xray配置文件69行(其中你需要修改4行), 其它都是用来检验小白输入错误参数或者搭建条件不满足的。
你如果不放心开源的脚本,你可以自己执行那8行有效语句,再修改配置文件中的4行,也能达到一样的效果。
Reality底层是TCP直连,如果你的VPS已经被墙,那肯定用不了。出门左转 https://github.com/crazypeace/v2ray_wss
apt update
apt install -y curl
bash <(curl -L https://github.com/crazypeace/xray-vless-reality/raw/main/install.sh)
脚本中很大部分都是在校验用户的输入。其实照着下面的步骤自己配置就行了。
具体手搓步骤 (点击展开)
sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control = bbr" >>/etc/sysctl.conf
echo "net.core.default_qdisc = fq" >>/etc/sysctl.conf
sysctl -p >/dev/null 2>&1
source: https://github.com/XTLS/Xray-install
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --beta
xray x25519
私钥会在服务端用到,公钥会在客户端用到。
xray uuid
比如,learn.microsoft.com
可选项见此:https://xtls.github.io/en/config/transport.html 不想选,就用random
个人使用可以不管,留空
{ // VLESS + Reality
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": 443, // 理论上可以随便改,不过从访问梯子的行为上,我个人认为使用443比较合适
"protocol": "vless",
"settings": {
"clients": [
{
"id": "你的UUID", // ***改这里
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false,
"dest": "你喜欢的网站:443", // ***如 learn.microsoft.com:443
"xver": 0,
"serverNames": ["你喜欢的网站"], //***如 learn.microsoft.com
"privateKey": "你的**私钥**", // ***改这里
"shortIds": [""] // 可以留空
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
}
],
"dns": {
"servers": [
"8.8.8.8",
"1.1.1.1",
"2001:4860:4860::8888",
"2606:4700:4700::1111",
"localhost"
]
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "block"
}
]
}
}
脚本最后会输出VLESS链接,方便你导入翻墙客户端。
如果你是手搓自建,请参考下图配置。特别需要注意的是,客户端用的是公钥。和服务端用的私钥不一样。
如果你是手搓VLESS链接,那么参考:XTLS/Xray-core#716
如 vless://${xray_id}@${ip}:443?encryption=none&flow=xtls-rprx-vision&security=reality&sni=${domain}&fp=${fingerprint}&pbk=${public_key}&type=tcp#VLESS_R_${ip}
bash <(curl -L git.io/warp.sh) 4
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove --purge
bash <(curl -L https://github.com/crazypeace/xray-vless-reality/raw/main/install.sh) <netstack> [port] [domain] [UUID]
其中,
netstack
6 表示 IPv6 入站; 4 表示 IPv4 入站.
port
端口. 不写的话, 默认443
domain
你指定的网站域名. 不写的话, 默认 learn.microsoft.com
UUID
你的UUID. 不写的话, 自动生成
例如,
bash <(curl -L https://github.com/crazypeace/xray-vless-reality/raw/main/install.sh) 6
bash <(curl -L https://github.com/crazypeace/xray-vless-reality/raw/main/install.sh) 6 443
bash <(curl -L https://github.com/crazypeace/xray-vless-reality/raw/main/install.sh) 6 443 learn.microsoft.com
bash <(curl -L https://github.com/crazypeace/xray-vless-reality/raw/main/install.sh) 6 443 learn.microsoft.com 1b0b723f-0544-4f9c-8df8-2b8975c5e47a