From a8f2be82bc3ad2dfe5a85a4eb8323a6f3bb73e73 Mon Sep 17 00:00:00 2001 From: dnomd343 Date: Fri, 9 Sep 2022 13:42:29 +0800 Subject: [PATCH] update: v2fly-core version `5.1.0` --- Dockerfile | 2 +- cmd/common/file.go | 2 +- cmd/config/decode.go | 2 +- cmd/controller.go | 2 +- cmd/proxy/main.go | 5 +---- cmd/xproxy.go | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e6d17e..8293b70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ COPY --from=upx /upx/ /usr/ RUN upx -9 /tmp/xray FROM golang:1.18-alpine3.16 AS v2ray -ENV V2FLY_VERSION="4.45.2" +ENV V2FLY_VERSION="5.1.0" RUN wget https://github.com/v2fly/v2ray-core/archive/refs/tags/v${V2FLY_VERSION}.tar.gz && tar xf v${V2FLY_VERSION}.tar.gz WORKDIR ./v2ray-core-${V2FLY_VERSION}/ RUN go mod download -x diff --git a/cmd/common/file.go b/cmd/common/file.go index 4ef423d..10af7b8 100644 --- a/cmd/common/file.go +++ b/cmd/common/file.go @@ -57,7 +57,7 @@ func ListFiles(folderPath string, suffix string) []string { func CopyFile(source string, target string) { log.Infof("Copy file `%s` => `%s`", source, target) if IsFileExist(target) { - log.Debugf("File `%s` will be overrided", target) + log.Debugf("File `%s` will be overridden", target) } srcFile, err := os.Open(source) defer srcFile.Close() diff --git a/cmd/config/decode.go b/cmd/config/decode.go index 4510053..23a2a1c 100644 --- a/cmd/config/decode.go +++ b/cmd/config/decode.go @@ -146,7 +146,7 @@ func decodeProxy(rawConfig *RawConfig, config *Config) { log.Debugf("Add-on inbounds -> %v", config.Proxy.AddOn) log.Debugf("Connection sniff -> %t", config.Proxy.Sniff.Enable) log.Debugf("Connection redirect -> %t", config.Proxy.Sniff.Redirect) - log.Debugf("Connection sniff exlcude -> %v", config.Proxy.Sniff.Exclude) + log.Debugf("Connection sniff exclude -> %v", config.Proxy.Sniff.Exclude) } func decodeRadvd(rawConfig *RawConfig, config *Config) { diff --git a/cmd/controller.go b/cmd/controller.go index 537ee1c..2609fc8 100644 --- a/cmd/controller.go +++ b/cmd/controller.go @@ -74,7 +74,7 @@ func runProxy(settings *config.Config) { if settings.Proxy.Core == "xray" { // xray-core runProcess([]string{"XRAY_LOCATION_ASSET=" + assetDir}, "xray", "-confdir", configDir) } else if settings.Proxy.Core == "v2ray" { // v2fly-core - runProcess([]string{"V2RAY_LOCATION_ASSET=" + assetDir}, "v2ray", "-confdir", configDir) + runProcess([]string{"V2RAY_LOCATION_ASSET=" + assetDir}, "v2ray", "run", "-d", configDir) } else if settings.Proxy.Core == "sagray" { // sager-core runProcess([]string{"V2RAY_LOCATION_ASSET=" + assetDir}, "sagray", "run", "-confdir", configDir) } else { diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 6699f44..01ddcd0 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -33,9 +33,6 @@ func loadInbounds(config *Config) string { DestOverride: []string{"http", "tls", "quic"}, DomainsExcluded: config.Sniff.Exclude, } - if config.Core == "v2ray" { // PATCH: v2fly-core v4 not support quic sniff - sniff.DestOverride = sniff.DestOverride[:len(sniff.DestOverride)-1] - } var inbounds []interface{} inbounds = append(inbounds, loadTProxyConfig("tproxy4", config.V4TProxyPort, sniff)) inbounds = append(inbounds, loadTProxyConfig("tproxy6", config.V6TProxyPort, sniff)) @@ -62,7 +59,7 @@ func Load(configDir string, exposeDir string, config *Config) { saveConfig(configDir, "log", loadLogConfig(config.Log, path.Join(exposeDir, "log")), true) for _, configFile := range common.ListFiles(path.Join(exposeDir, "config"), ".json") { if configFile == "log.json" || configFile == "inbounds" { - log.Warningf("Config file %s will be override", configFile) + log.Warningf("Config file %s will be overridden", configFile) } common.CopyFile(path.Join(exposeDir, "config", configFile), path.Join(configDir, configFile)) } diff --git a/cmd/xproxy.go b/cmd/xproxy.go index d53b3f1..7b6b736 100644 --- a/cmd/xproxy.go +++ b/cmd/xproxy.go @@ -13,7 +13,7 @@ import ( "strconv" ) -var version = "1.0.0" +var version = "1.0.1" var v4RouteTable = 104 var v6RouteTable = 106 var v4TProxyPort = 7288