From 9e8f87740ee3b2a0788f32a46564e2d1b15cb10c Mon Sep 17 00:00:00 2001 From: wyx2685 Date: Tue, 30 Jul 2024 01:28:39 +0900 Subject: [PATCH] update xray-core 1.8.23 --- .github/workflows/Publish Docker image.yml | 12 ++---------- core/sing/hook.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- limiter/limiter.go | 2 +- main.go | 7 ------- 6 files changed, 7 insertions(+), 22 deletions(-) diff --git a/.github/workflows/Publish Docker image.yml b/.github/workflows/Publish Docker image.yml index e6dd6ef..9d540b8 100644 --- a/.github/workflows/Publish Docker image.yml +++ b/.github/workflows/Publish Docker image.yml @@ -1,16 +1,8 @@ name: Publish Docker image on: workflow_dispatch: - push: - branches: - - dev_new - paths: - - "**/*.go" - - "go.mod" - - "go.sum" - - ".github/workflows/*.yml" - tags: - - 'v*' + release: + types: [published] pull_request: branches: - 'dev_new' diff --git a/core/sing/hook.go b/core/sing/hook.go index a68105f..307d759 100644 --- a/core/sing/hook.go +++ b/core/sing/hook.go @@ -162,7 +162,7 @@ func (h *HookServer) RoutedPacketConnection(_ context.Context, conn N.PacketConn return conn, t } ip := m.Source.Addr.String() - if b, r := l.CheckLimit(format.UserTag(m.Inbound, m.User), ip, true, false); r { + if b, r := l.CheckLimit(format.UserTag(m.Inbound, m.User), ip, false, false); r { conn.Close() log.Error("[", m.Inbound, "] ", "Limited ", m.User, " by ip or conn") return conn, t diff --git a/go.mod b/go.mod index 9ef2692..0562a74 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.15.0 - github.com/xtls/xray-core v1.8.21 + github.com/xtls/xray-core v1.8.23 go.uber.org/zap v1.27.0 golang.org/x/crypto v0.25.0 golang.org/x/sys v0.22.0 diff --git a/go.sum b/go.sum index cd1aa75..ea2c342 100644 --- a/go.sum +++ b/go.sum @@ -949,8 +949,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d h1:+B97uD9uHLgAAulhigmys4BVwZZypzK7gPN3WtpgRJg= github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d/go.mod h1:dm4y/1QwzjGaK17ofi0Vs6NpKAHegZky8qk6J2JJZAE= -github.com/xtls/xray-core v1.8.21 h1:cNdepud+R9PENKzXlSZsq0je4BWI6liXAuep6CD6xvk= -github.com/xtls/xray-core v1.8.21/go.mod h1:0CwyMPNA5Cs+ukPXHbYQGgne/ug0PuXOSVqBu7zyXOc= +github.com/xtls/xray-core v1.8.23 h1:A8Wr50ildMYLpaNu3EiK+Stg/tps6i0h7z5Hr4f9H2k= +github.com/xtls/xray-core v1.8.23/go.mod h1:0CwyMPNA5Cs+ukPXHbYQGgne/ug0PuXOSVqBu7zyXOc= github.com/yandex-cloud/go-genproto v0.0.0-20240318083951-4fe6125f286e h1:jLIqA7M9qY31g/Nw/5htVD0DFbxmLnlFZcHKJiG3osI= github.com/yandex-cloud/go-genproto v0.0.0-20240318083951-4fe6125f286e/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE= github.com/yandex-cloud/go-sdk v0.0.0-20240318084659-dfa50323a0b4 h1:wtzLQJmghkSUb1YkeFphIh7ST7NNVDaVOJZSAJcjMdw= diff --git a/limiter/limiter.go b/limiter/limiter.go index d421500..e8e3117 100644 --- a/limiter/limiter.go +++ b/limiter/limiter.go @@ -183,7 +183,7 @@ func (l *Limiter) CheckLimit(taguuid string, ip string, isTcp bool, noSSUDP bool limit := int64(determineSpeedLimit(nodeLimit, userLimit)) * 1000000 / 8 // If you need the Speed limit if limit > 0 { - Bucket = ratelimit.NewBucketWithQuantum(time.Second, limit, limit) // Byte/s + Bucket = ratelimit.NewBucketWithQuantum(time.Second, 5*limit, limit) // Byte/s if v, ok := l.SpeedLimiter.LoadOrStore(taguuid, Bucket); ok { return v.(*ratelimit.Bucket), false } else { diff --git a/main.go b/main.go index 9bf8fcc..4f20c97 100644 --- a/main.go +++ b/main.go @@ -1,16 +1,9 @@ package main import ( - //"net/http" - //_ "net/http/pprof" - "github.com/InazumaV/V2bX/cmd" ) func main() { - //内存泄漏排查 - //go func() { - // http.ListenAndServe("127.0.0.1:6060", nil) - //}() cmd.Run() }