|
|
@@ -6,6 +6,8 @@ import (
|
|
|
"sort"
|
|
|
"strings"
|
|
|
|
|
|
+ "github.com/v2fly/v2ray-core/v4/common/platform"
|
|
|
+
|
|
|
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
|
|
"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
|
|
|
rule2 "github.com/v2fly/v2ray-core/v4/infra/conf/rule"
|
|
|
@@ -140,8 +142,6 @@ type DNSConfig struct {
|
|
|
QueryStrategy string `json:"queryStrategy"`
|
|
|
DisableCache bool `json:"disableCache"`
|
|
|
DisableFallback bool `json:"disableFallback"`
|
|
|
-
|
|
|
- GeoLoader string `json:"geoLoader"`
|
|
|
}
|
|
|
|
|
|
type HostAddress struct {
|
|
|
@@ -194,11 +194,11 @@ func getHostMapping(ha *HostAddress) *dns.Config_HostMapping {
|
|
|
func (c *DNSConfig) Build() (*dns.Config, error) {
|
|
|
cfgctx := cfgcommon.NewConfigureLoadingContext(context.Background())
|
|
|
|
|
|
- if c.GeoLoader == "" {
|
|
|
- c.GeoLoader = "standard"
|
|
|
- }
|
|
|
+ geoloadername := platform.NewEnvFlag("v2ray.conf.geoloader").GetValue(func() string {
|
|
|
+ return "standard"
|
|
|
+ })
|
|
|
|
|
|
- if loader, err := geodata.GetGeoDataLoader(c.GeoLoader); err == nil {
|
|
|
+ if loader, err := geodata.GetGeoDataLoader(geoloadername); err == nil {
|
|
|
cfgcommon.SetGeoDataLoader(cfgctx, loader)
|
|
|
} else {
|
|
|
return nil, newError("unable to create geo data loader ").Base(err)
|