mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-05 16:55:27 -05:00
refine
This commit is contained in:
@@ -13,18 +13,22 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
|
||||
)
|
||||
|
||||
func init() {
|
||||
const (
|
||||
geoipURL = "https://raw.githubusercontent.com/v2fly/geoip/release/geoip.dat"
|
||||
geositeURL = "https://raw.githubusercontent.com/v2fly/domain-list-community/release/dlc.dat"
|
||||
)
|
||||
|
||||
wd, err := os.Getwd()
|
||||
common.Must(err)
|
||||
|
||||
tempPath := filepath.Join(wd, "..", "..", "testing", "temp")
|
||||
os.Setenv("v2ray.location.asset", tempPath)
|
||||
geoipPath := filepath.Join(tempPath, "geoip.dat")
|
||||
|
||||
geoipPath := platform.GetAssetLocation("geoip.dat")
|
||||
os.Setenv("v2ray.location.asset", tempPath)
|
||||
|
||||
if _, err := os.Stat(geoipPath); err != nil && errors.Is(err, fs.ErrNotExist) {
|
||||
common.Must(os.MkdirAll(tempPath, 0755))
|
||||
|
||||
Reference in New Issue
Block a user