Direct/Freedom outbound: Better Compatibility (#896)

https://github.com/XTLS/Xray-core/pull/6058
This commit is contained in:
Meow
2026-09-11 06:46:51 +08:00
committed by GitHub
parent 9125d3237c
commit b7207f4da4
30 changed files with 451 additions and 477 deletions
+13 -13
View File
@@ -114,8 +114,10 @@ lsmod | grep wireguard
"outbounds": [
{
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIPv4"
"streamSettings": {
"sockopt": {
"domainStrategy": "UseIPv4"
}
}
//修改此处,可v4或者v6
},
@@ -125,11 +127,9 @@ lsmod | grep wireguard
"tag": "wg0",
"streamSettings": {
"sockopt": {
"mark": 255 // <mark>
"mark": 255, // <mark>
"domainStrategy": "UseIPv6"
}
},
"settings": {
"domainStrategy": "UseIPv6"
}
}, //设置fwmark为<mark>的用户走指定方式”UseIPv6””UseIPv4”
// <--请在不同的方案中选择--> 方案2:sendThrough
@@ -138,8 +138,10 @@ lsmod | grep wireguard
"protocol": "freedom",
"sendThrough": "your wg0 v4 address",
//修改此处,可v4或者v6
"settings": {
"domainStrategy": "UseIPv4"
"streamSettings": {
"sockopt": {
"domainStrategy": "UseIPv4"
}
}
//修改此处,可v4或者v6
},
@@ -147,12 +149,10 @@ lsmod | grep wireguard
{
"tag": "wg0",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIPv4"
},
"streamSettings": {
"sockopt": {
"interface": "wg0"
"interface": "wg0",
"domainStrategy": "UseIPv4"
}
}
},
@@ -193,7 +193,7 @@ lsmod | grep wireguard
```
::: tip
可以通过修改 "domainStrategy": "UseIPv6"来控制对应用户的访问方式 实测优先级要高于系统本身的 gai.config
可以通过修改 `sockopt.domainStrategy` 为 `UseIPv6` 来控制对应用户的访问方式。
:::
## 5、系统设置配置
+4 -8
View File
@@ -52,12 +52,10 @@ sudo curl -oL /usr/local/share/xray/geosite.dat https://github.com/Loyalsoldier/
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIPv4"
},
"streamSettings": {
"sockopt": {
"mark": 2
"mark": 2,
"domainStrategy": "UseIPv4"
}
}
},
@@ -94,12 +92,10 @@ sudo curl -oL /usr/local/share/xray/geosite.dat https://github.com/Loyalsoldier/
"settings": {
"rewriteAddress": "8.8.8.8"
},
"proxySettings": {
"tag": "proxy"
},
"streamSettings": {
"sockopt": {
"mark": 2
"mark": 2,
"dialerProxy": "proxy"
}
}
}
@@ -91,12 +91,10 @@
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIP"
},
"streamSettings": {
"sockopt": {
"mark": 255
"mark": 255,
"domainStrategy": "UseIP"
}
}
},