Update examples from deprecated flows to Vision

This commit is contained in:
yuhan6665
2022-12-26 12:12:42 -05:00
parent 278eabf51c
commit a12e0378b0
10 changed files with 323 additions and 301 deletions
+12 -8
View File
@@ -227,7 +227,7 @@
},
// 3*分流设置
"routing": {
"domainStrategy": "AsIs",
"domainStrategy": "IPIfNonMatch",
"rules": [
// 3.1 防止服务器本地流转问题:如内网被攻击或滥用、错误的本地回环等
{
@@ -237,7 +237,14 @@
],
"outboundTag": "block" // 分流策略:交给出站"block"处理(黑洞屏蔽)
},
// 3.2 屏蔽广告
{ // 3.2 防止服务器直连国内
"type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "block"
},
// 3.3 屏蔽广告
{
"type": "field",
"domain": [
@@ -257,7 +264,7 @@
"clients": [
{
"id": "", // 填写你的 UUID
"flow": "xtls-rprx-direct",
"flow": "xtls-rprx-vision",
"level": 0,
"email": "vpsadmin@yourdomain.com"
}
@@ -271,11 +278,8 @@
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"allowInsecure": false, // 正常使用应确保关闭
"minVersion": "1.2", // TLS 最低版本设置
"alpn": ["http/1.1"],
"security": "tls",
"tlsSettings": {
"certificates": [
{
"certificateFile": "/home/vpsadmin/xray_cert/xray.crt",
+5 -5
View File
@@ -226,8 +226,7 @@
"users": [
{
"id": "uuiduuid-uuid-uuid-uuid-uuiduuiduuid", // 和服务器端的一致
"flow": "xtls-rprx-direct", // Windows, macOS 同学保持这个不变
// "flow": "xtls-rprx-splice", // Linux和安卓同学请改成Splice性能更强
"flow": "xtls-rprx-vision",
"encryption": "none",
"level": 0
}
@@ -237,10 +236,11 @@
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"security": "tls",
"tlsSettings": {
"serverName": "a-name.yourdomain.com", // 替换成你的真实域名
"allowInsecure": false // 禁止不安全证书
"allowInsecure": false, // 禁止不安全证书
"fingerprint": "chrome" // 通过 uTLS 库 模拟 Chrome / Firefox / Safari 或随机生成的指纹
}
}
},
+3 -3
View File
@@ -143,7 +143,7 @@
"clients": [
{
"id": "", // 填写你的 UUID
"flow": "xtls-rprx-direct",
"flow": "xtls-rprx-vision",
"level": 0,
"email": "love@example.com"
}
@@ -173,8 +173,8 @@
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"security": "tls",
"tlsSettings": {
"alpn": ["http/1.1"],
"certificates": [
{
+5 -5
View File
@@ -87,7 +87,7 @@ acme.sh --install-cert -d example.com --fullchain-file /etc/ssl/xray/cert.pem --
"clients": [
{
"id": "UUID",
"flow": "xtls-rprx-direct"
"flow": "xtls-rprx-vision"
}
],
"decryption": "none",
@@ -122,8 +122,8 @@ acme.sh --install-cert -d example.com --fullchain-file /etc/ssl/xray/cert.pem --
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"security": "tls",
"tlsSettings": {
"alpn": ["h2", "http/1.1"],
"certificates": [
{
@@ -181,9 +181,9 @@ acme.sh --install-cert -d example.com --fullchain-file /etc/ssl/xray/cert.pem --
- 有关 HTTP/2
首先,`inbounds.streamSettings.xtlsSettings.alpn` 有顺序,应将 `h2` 放前,`http/1.1` 放后,在优先使用 HTTP/2 的同时保证兼容性;反过来会导致 HTTP/2 在协商时变为 HTTP/1.1,成为无效配置。
首先,`inbounds.streamSettings.tlsSettings.alpn` 有顺序,应将 `h2` 放前,`http/1.1` 放后,在优先使用 HTTP/2 的同时保证兼容性;反过来会导致 HTTP/2 在协商时变为 HTTP/1.1,成为无效配置。
在上述配置中,每条回落到 Nginx 的配置都要分成两个。这是因为 h2 是强制 TLS 加密的 HTTP/2 连接,这有益于数据在互联网中传输的安全,但在服务器内部没有必要;而 h2c 是非加密的 HTTP/2 连接,适合该环境。然而,Nginx 不能在同一端口上同时监听 HTTP/1.1 和 h2c,为了解决这个问题,需要在回落中指定 `alpn` 项(是 `fallbacks` 而不是 `xtlsSettings` 里面的),以尝试匹配 TLS ALPN 协商结果。
在上述配置中,每条回落到 Nginx 的配置都要分成两个。这是因为 h2 是强制 TLS 加密的 HTTP/2 连接,这有益于数据在互联网中传输的安全,但在服务器内部没有必要;而 h2c 是非加密的 HTTP/2 连接,适合该环境。然而,Nginx 不能在同一端口上同时监听 HTTP/1.1 和 h2c,为了解决这个问题,需要在回落中指定 `alpn` 项(是 `fallbacks` 而不是 `tlsSettings` 里面的),以尝试匹配 TLS ALPN 协商结果。
建议 `alpn` 项只按需用两种填法:[^4]
+7 -5
View File
@@ -73,7 +73,7 @@
**出站:** 就是流量如何流出 `Xray`
:::
下面的出站配置示例,用大白话说就是:数据按照 `VLESS` 协议,以 `tcp + xtls (direct)` 的方式、及其他相关设置,把流量发送给对应的 VPS。同时,`Xray` 将这个出站用 `[tag]` 命名为 `proxy-out-vless`:
下面的出站配置示例,用大白话说就是:数据按照 `VLESS` 协议,以 `tcp + xtls` 的方式、及其他相关设置,把流量发送给对应的 VPS。同时,`Xray` 将这个出站用 `[tag]` 命名为 `proxy-out-vless`:
```json
{
@@ -89,7 +89,7 @@
"users": [
{
"id": "uuiduuid-uuid-uuid-uuid-uuiduuiduuid",
"flow": "xtls-rprx-direct",
"flow": "xtls-rprx-vision",
"encryption": "none",
"level": 0
}
@@ -99,9 +99,11 @@
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"serverName": "a-name.yourdomain.com"
"security": "tls",
"tlsSettings": {
"serverName": "a-name.yourdomain.com",
"allowInsecure": false,
"fingerprint": "chrome"
}
}
}