Fix dns outbound

This commit is contained in:
世界 2022-07-31 08:48:21 +08:00
parent c57ea9e47c
commit 0eed0ca11a
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 28 additions and 3 deletions

View file

@ -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()

View file

@ -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"
}
] ]
}
} }