add list support for auther, admission and bypass

This commit is contained in:
ginuerzh
2022-08-23 21:49:49 +08:00
parent fe6554d8a3
commit bdd239fb09
11 changed files with 134 additions and 71 deletions

View File

@ -19,7 +19,8 @@ type metadata struct {
timeout time.Duration
clientIP net.IP
// nameservers
dns []string
dns []string
bufferSize int
}
func (h *dnsHandler) parseMetadata(md mdata.Metadata) (err error) {
@ -29,6 +30,7 @@ func (h *dnsHandler) parseMetadata(md mdata.Metadata) (err error) {
timeout = "timeout"
clientIP = "clientIP"
dns = "dns"
bufferSize = "bufferSize"
)
h.md.readTimeout = mdx.GetDuration(md, readTimeout)
@ -42,6 +44,10 @@ func (h *dnsHandler) parseMetadata(md mdata.Metadata) (err error) {
h.md.clientIP = net.ParseIP(sip)
}
h.md.dns = mdx.GetStrings(md, dns)
h.md.bufferSize = mdx.GetInt(md, bufferSize)
if h.md.bufferSize <= 0 {
h.md.bufferSize = defaultBufferSize
}
return
}