本站支持「有偿」远程协助!

Xray: Vless gRPC tls cdn

Cloudflare 中转 gRPC 节点会被限速, 转身 ws 是不错的选择.

域名注册

昔日在 namecheap 购买域名, 时长达 6 月, 申请转移服务商到cloudflare, 直接在 Cloudflare 注册域名现已不是问题.

gRPC 选项

CF 面板, 网络选项 , 开启 gRPC 选项.

修改 SSL/TLS 加密模式

接着在 SSL/tls 面板当中,将加密模式设置为 完全(严格)

创建 CDN 专用证书

切换到原服务器选项,点击创建证书。私钥类型选择 ecc ,其他保持默认不变,可以看到证书的时效期是 15 年。

自运行脚本设置

#!/bin/sh

# Xray Installation
wget -O /usr/local/bin/xray https://github.com/none-blue/xray-amd64/raw/main/xray
chmod +x /usr/local/bin/xray

cat <<EOF > /etc/systemd/system/xray.service
[Unit]
Description=The Xray Proxy Serve
After=network-online.target

[Service]
ExecStart=/usr/local/bin/xray -c /etc/xray/serve.toml
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=always
RestartSec=15s

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable xray

# Xray Configuration
# id = "none.blue" and serviceName = "page" should custom
mkdir -p /etc/xray
cat <<EOF > /etc/xray/serve.toml
[log]
loglevel = "none"

[[inbounds]]
port = 443
protocol = "vless"

[inbounds.settings]
decryption = "none"

[[inbounds.settings.clients]]
id = "none.blue"

[inbounds.streamSettings]
network = "grpc"
security = "tls"

[inbounds.streamSettings.grpcSettings]
serviceName = "page"

[inbounds.streamSettings.tlsSettings]
alpn = "h2"

[[inbounds.streamSettings.tlsSettings.certificates]]
certificateFile = "/etc/xray/cert.pem"
keyFile = "/etc/xray/key.pem"

[[outbounds]]
protocol = "freedom"
EOF

# pem fortmat certificate from cloudflare
cat <<EOF > /etc/xray/cert.pem
-----BEGIN CERTIFICATE-----
. . .
-----END CERTIFICATE-----
EOF

# pem fortmat private key from cloudflare
cat <<EOF > /etc/xray/key.pem
-----BEGIN PRIVATE KEY-----
. . .
-----END PRIVATE KEY-----
EOF

systemctl start xray
#systemctl status xray

客户端 V2rayN 示例

Windows 上使用 chocolatey 包管理工具安装 V2rayN,在其设置当中找到内核设置,选择类型为 Xray_core。点击左上角服务器,选择添加 Vless 服务器,设置参考下图。

choco install v2rayn -y

Cloudflare 优选 IP

关闭所有代理软件,使用 cloud flare 优选工具,筛选出速度较快的 IP 地址。克隆当前 gRPC 节点,更换服务器地址为优选 IP 地址,指定 sni为自己设置的解析域名.

Loading ...
无广告!