mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Add "nonIPQuery" to DNS outbound ("drop" by default)
And fixed a memory leak And regenerated *.pb.go
This commit is contained in:
parent
62e881b01a
commit
667279af57
5 changed files with 38 additions and 14 deletions
|
@ -7,10 +7,11 @@ import (
|
|||
)
|
||||
|
||||
type DNSOutboundConfig struct {
|
||||
Network Network `json:"network"`
|
||||
Address *Address `json:"address"`
|
||||
Port uint16 `json:"port"`
|
||||
UserLevel uint32 `json:"userLevel"`
|
||||
Network Network `json:"network"`
|
||||
Address *Address `json:"address"`
|
||||
Port uint16 `json:"port"`
|
||||
UserLevel uint32 `json:"userLevel"`
|
||||
NonIPQuery string `json:"nonIPQuery"`
|
||||
}
|
||||
|
||||
func (c *DNSOutboundConfig) Build() (proto.Message, error) {
|
||||
|
@ -24,5 +25,12 @@ func (c *DNSOutboundConfig) Build() (proto.Message, error) {
|
|||
if c.Address != nil {
|
||||
config.Server.Address = c.Address.Build()
|
||||
}
|
||||
switch c.NonIPQuery {
|
||||
case "":
|
||||
c.NonIPQuery = "drop"
|
||||
case "drop", "skip":
|
||||
default:
|
||||
return nil, newError(`unknown "nonIPQuery": `, c.NonIPQuery)
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue