0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-18 14:19:48 +03:00

refactor: new dns app

This commit is contained in:
AkinoKaede
2021-03-18 23:24:24 +08:00
parent 4e63c22197
commit 8884e948fe
24 changed files with 1240 additions and 620 deletions

View File

@ -37,4 +37,7 @@ type Context interface {
// GetAttributes returns extra attributes from the conneciont content.
GetAttributes() map[string]string
// GetSkipDNSResolve returns a flag switch for weather skip dns resolve during route pick.
GetSkipDNSResolve() bool
}

View File

@ -109,6 +109,14 @@ func (ctx *Context) GetAttributes() map[string]string {
return ctx.Content.Attributes
}
// GetSkipDNSResolve implements routing.Context.
func (ctx *Context) GetSkipDNSResolve() bool {
if ctx.Content == nil {
return false
}
return ctx.Content.SkipDNSResolve
}
// AsRoutingContext creates a context from context.context with session info.
func AsRoutingContext(ctx context.Context) routing.Context {
return &Context{