mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-05 11:48:41 +00:00
refactor: new dns app
This commit is contained in:
parent
4e63c22197
commit
8884e948fe
24 changed files with 1240 additions and 620 deletions
|
@ -108,10 +108,11 @@ var typeMap = map[router.Domain_Type]dns.DomainMatchingType{
|
|||
|
||||
// DNSConfig is a JSON serializable object for dns.Config.
|
||||
type DNSConfig struct {
|
||||
Servers []*NameServerConfig `json:"servers"`
|
||||
Hosts map[string]*Address `json:"hosts"`
|
||||
ClientIP *Address `json:"clientIp"`
|
||||
Tag string `json:"tag"`
|
||||
Servers []*NameServerConfig `json:"servers"`
|
||||
Hosts map[string]*Address `json:"hosts"`
|
||||
ClientIP *Address `json:"clientIp"`
|
||||
Tag string `json:"tag"`
|
||||
DisableCache bool `json:"disableCache"`
|
||||
}
|
||||
|
||||
func getHostMapping(addr *Address) *dns.Config_HostMapping {
|
||||
|
@ -129,7 +130,8 @@ func getHostMapping(addr *Address) *dns.Config_HostMapping {
|
|||
// Build implements Buildable
|
||||
func (c *DNSConfig) Build() (*dns.Config, error) {
|
||||
config := &dns.Config{
|
||||
Tag: c.Tag,
|
||||
Tag: c.Tag,
|
||||
DisableCache: c.DisableCache,
|
||||
}
|
||||
|
||||
if c.ClientIP != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue