mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 21:51:23 +08:00
17 lines
396 B
Go
17 lines
396 B
Go
|
package dns
|
||
|
|
||
|
import D "github.com/miekg/dns"
|
||
|
|
||
|
type LocalServer struct {
|
||
|
handler handler
|
||
|
}
|
||
|
|
||
|
// ServeMsg implement resolver.LocalServer ResolveMsg
|
||
|
func (s *LocalServer) ServeMsg(msg *D.Msg) (*D.Msg, error) {
|
||
|
return handlerWithContext(s.handler, msg)
|
||
|
}
|
||
|
|
||
|
func NewLocalServer(resolver *Resolver, mapper *ResolverEnhancer) *LocalServer {
|
||
|
return &LocalServer{handler: NewHandler(resolver, mapper)}
|
||
|
}
|