mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 08:31:30 +00:00
Fix dns outbound
This commit is contained in:
parent
c57ea9e47c
commit
0eed0ca11a
|
@ -82,7 +82,7 @@ func (d *DNS) NewConnection(ctx context.Context, conn net.Conn, metadata adapter
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_responseBuffer := buf.StackNewSize(1024)
|
_responseBuffer := buf.StackNewPacket()
|
||||||
defer common.KeepAlive(_responseBuffer)
|
defer common.KeepAlive(_responseBuffer)
|
||||||
responseBuffer := common.Dup(_responseBuffer)
|
responseBuffer := common.Dup(_responseBuffer)
|
||||||
defer responseBuffer.Release()
|
defer responseBuffer.Release()
|
||||||
|
@ -133,7 +133,7 @@ func (d *DNS) NewPacketConnection(ctx context.Context, conn N.PacketConn, metada
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
timeout.Update()
|
timeout.Update()
|
||||||
_responseBuffer := buf.StackNewSize(1024)
|
_responseBuffer := buf.StackNewPacket()
|
||||||
defer common.KeepAlive(_responseBuffer)
|
defer common.KeepAlive(_responseBuffer)
|
||||||
responseBuffer := common.Dup(_responseBuffer)
|
responseBuffer := common.Dup(_responseBuffer)
|
||||||
defer responseBuffer.Release()
|
defer responseBuffer.Release()
|
||||||
|
|
|
@ -2,13 +2,38 @@
|
||||||
"log": {
|
"log": {
|
||||||
"level": "info"
|
"level": "info"
|
||||||
},
|
},
|
||||||
|
"dns": {
|
||||||
|
"servers": [
|
||||||
|
{
|
||||||
|
"address": "tls://8.8.8.8"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"inbounds": [
|
"inbounds": [
|
||||||
{
|
{
|
||||||
"type": "shadowsocks",
|
"type": "shadowsocks",
|
||||||
"listen": "::",
|
"listen": "::",
|
||||||
"listen_port": 8080,
|
"listen_port": 8080,
|
||||||
|
"sniff": true,
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"outbounds": [
|
||||||
|
{
|
||||||
|
"type": "direct"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "dns",
|
||||||
|
"tag": "dns-out"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"route": {
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"protocol": "dns",
|
||||||
|
"outbound": "dns-out"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue