mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-03 12:20:27 +08:00
智能DNS支持自定义端口
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
|
||||
package dnsconfigs
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
)
|
||||
|
||||
type NSNodeConfig struct {
|
||||
Id int64 `yaml:"id" json:"id"`
|
||||
@@ -12,6 +15,10 @@ type NSNodeConfig struct {
|
||||
AccessLogRef *NSAccessLogRef `yaml:"accessLogRef" json:"accessLogRef"`
|
||||
RecursionConfig *RecursionConfig `yaml:"recursionConfig" json:"recursionConfig"`
|
||||
|
||||
TCP *serverconfigs.TCPProtocolConfig `yaml:"tcp" json:"tcp"` // TCP配置
|
||||
TLS *serverconfigs.TLSProtocolConfig `yaml:"tls" json:"tls"` // TLS配置
|
||||
UDP *serverconfigs.UDPProtocolConfig `yaml:"udp" json:"udp"` // UDP配置
|
||||
|
||||
paddedId string
|
||||
}
|
||||
|
||||
@@ -26,6 +33,30 @@ func (this *NSNodeConfig) Init() error {
|
||||
}
|
||||
}
|
||||
|
||||
// tcp
|
||||
if this.TCP != nil {
|
||||
err := this.TCP.Init()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// tls
|
||||
if this.TLS != nil {
|
||||
err := this.TLS.Init()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// udp
|
||||
if this.UDP != nil {
|
||||
err := this.UDP.Init()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user