Files
EdgeNode/internal/configs/protocol_https_config.go
2020-07-21 11:18:47 +08:00

23 lines
614 B
Go

package configs
type HTTPSProtocolConfig struct {
IsOn bool `yaml:"isOn"` // 是否开启
IPVersion string `yaml:"ipVersion"` // 4, 6
Listen []string `yaml:"listen" json:"listen"` // 监听地址
}
func (this *HTTPSProtocolConfig) Addresses() []string {
result := []string{}
for _, listen := range this.Listen {
switch this.IPVersion {
case IPv4:
result = append(result, ProtocolHTTPS4+"://"+listen)
case IPv6:
result = append(result, ProtocolHTTPS6+"://"+listen)
default:
result = append(result, ProtocolHTTPS+"://"+listen)
}
}
return result
}