You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
v2ray-core/tools/conf/freedom.go

25 lines
603 B

package conf
import (
"strings"
"v2ray.com/core/common/loader"
"v2ray.com/core/proxy/freedom"
)
type FreedomConfig struct {
DomainStrategy string `json:"domainStrategy"`
Timeout uint32 `json:"timeout"`
}
8 years ago
func (v *FreedomConfig) Build() (*loader.TypedSettings, error) {
config := new(freedom.Config)
config.DomainStrategy = freedom.Config_AS_IS
8 years ago
domainStrategy := strings.ToLower(v.DomainStrategy)
if domainStrategy == "useip" || domainStrategy == "use_ip" {
config.DomainStrategy = freedom.Config_USE_IP
}
8 years ago
config.Timeout = v.Timeout
return loader.NewTypedSettings(config), nil
}