mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-03 02:38:40 +00:00
refactor: new dns app
This commit is contained in:
parent
4e63c22197
commit
8884e948fe
24 changed files with 1240 additions and 620 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue