Browse Source

update: add dns object

master
dnomd343 4 years ago
parent
commit
7e26d27744
  1. 22
      README.md
  2. 23
      load.sh

22
README.md

@ -82,12 +82,12 @@ shell> docker ps -a
}
```
`routeing.json` 默认配置将全部流量交由 `node` 接口,即 `outbounds.json` 中的 `freedom` 出口,具体语法见[Xray文档](https://xtls.github.io/config/base/routing/)
`routing.json` 默认配置将全部流量交由 `node` 接口,即 `outbounds.json` 中的 `freedom` 出口,具体语法见[Xray文档](https://xtls.github.io/config/base/routing/)
```
{
"routing": {
"domainStrategy": "AsIs",
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
@ -98,10 +98,7 @@ shell> docker ps -a
},
{
"type": "field",
"ip": [
"0.0.0.0/0",
"::/0"
],
"network": "tcp,udp"
"outboundTag": "node"
}
]
@ -109,6 +106,19 @@ shell> docker ps -a
}
```
`dns.json` 指定路由匹配时的DNS服务器,具体语法见[Xray文档](https://xtls.github.io/config/base/dns/)
```
{
"dns": {
"servers": [
"223.5.5.5",
"119.29.29.29"
]
}
}
```
`segment` 文件夹下默认存储 `ipv4``ipv6` 两个文件,其中存储不代理的网段信息,建议绕过内网地址、本地回环地址、链路本地地址、组播地址等网段
```

23
load.sh

@ -111,7 +111,7 @@ load_routing(){
cat>$XRAY_DIR/expose/routing.json<<EOF
{
"routing": {
"domainStrategy": "AsIs",
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
@ -122,10 +122,7 @@ cat>$XRAY_DIR/expose/routing.json<<EOF
},
{
"type": "field",
"ip": [
"0.0.0.0/0",
"::/0"
],
"network": "tcp,udp"
"outboundTag": "node"
}
]
@ -134,6 +131,20 @@ cat>$XRAY_DIR/expose/routing.json<<EOF
EOF
}
load_dns(){
cat>$XRAY_DIR/expose/dns.json<<EOF
{
"dns": {
"servers": [
"223.5.5.5",
"119.29.29.29"
]
}
}
EOF
}
load_ipv4(){
cat>$XRAY_DIR/expose/segment/ipv4<<EOF
127.0.0.0/8
@ -160,7 +171,9 @@ load_inbounds
load_log
[ ! -s "$XRAY_DIR/expose/outbounds.json" ] && load_outbounds
[ ! -s "$XRAY_DIR/expose/routing.json" ] && load_routing
[ ! -s "$XRAY_DIR/expose/dns.json" ] && load_dns
cp $XRAY_DIR/expose/outbounds.json $XRAY_DIR/conf/
cp $XRAY_DIR/expose/routing.json $XRAY_DIR/conf/
cp $XRAY_DIR/expose/dns.json $XRAY_DIR/conf/
[ ! -s "$XRAY_DIR/expose/segment/ipv4" ] && load_ipv4
[ ! -s "$XRAY_DIR/expose/segment/ipv6" ] && load_ipv6

Loading…
Cancel
Save