From ffab01730a6cee644ff091a2ed09e09f9d8ea8d6 Mon Sep 17 00:00:00 2001 From: Toby Date: Tue, 18 Mar 2025 20:44:59 -0700 Subject: [PATCH 1/7] chore: add LICENSE to packages --- app/LICENSE.md | 7 +++++++ core/LICENSE.md | 7 +++++++ extras/LICENSE.md | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 app/LICENSE.md create mode 100644 core/LICENSE.md create mode 100644 extras/LICENSE.md diff --git a/app/LICENSE.md b/app/LICENSE.md new file mode 100644 index 0000000..208e8f2 --- /dev/null +++ b/app/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2023 Toby + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/core/LICENSE.md b/core/LICENSE.md new file mode 100644 index 0000000..208e8f2 --- /dev/null +++ b/core/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2023 Toby + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/extras/LICENSE.md b/extras/LICENSE.md new file mode 100644 index 0000000..208e8f2 --- /dev/null +++ b/extras/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2023 Toby + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 5239a23aee96c54a372cbb6bd4dd82e65e09321f Mon Sep 17 00:00:00 2001 From: dropbigfish Date: Sun, 20 Apr 2025 12:06:13 +0800 Subject: [PATCH 2/7] chore: fix function name in comment Signed-off-by: dropbigfish --- core/internal/congestion/bbr/packet_number_indexed_queue.go | 2 +- extras/trafficlogger/http.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/internal/congestion/bbr/packet_number_indexed_queue.go b/core/internal/congestion/bbr/packet_number_indexed_queue.go index 86fe52d..08b99de 100644 --- a/core/internal/congestion/bbr/packet_number_indexed_queue.go +++ b/core/internal/congestion/bbr/packet_number_indexed_queue.go @@ -152,7 +152,7 @@ func (p *packetNumberIndexedQueue[T]) EntrySlotsUsed() int { return p.entries.Len() } -// LastPacket returns packet number of the first entry in the queue. +// FirstPacket returns packet number of the first entry in the queue. func (p *packetNumberIndexedQueue[T]) FirstPacket() (packetNumber congestion.PacketNumber) { return p.firstPacket } diff --git a/extras/trafficlogger/http.go b/extras/trafficlogger/http.go index d8e6ebd..8b26217 100644 --- a/extras/trafficlogger/http.go +++ b/extras/trafficlogger/http.go @@ -71,7 +71,7 @@ func (s *trafficStatsServerImpl) LogTraffic(id string, tx, rx uint64) (ok bool) return true } -// LogOnlineStateChanged updates the online state to the online map. +// LogOnlineState updates the online state to the online map. func (s *trafficStatsServerImpl) LogOnlineState(id string, online bool) { s.Mutex.Lock() defer s.Mutex.Unlock() From 29cd04fdef147136afaaafd29c1274f1cbcd8bea Mon Sep 17 00:00:00 2001 From: Toby Date: Sun, 20 Apr 2025 14:04:53 -0700 Subject: [PATCH 3/7] feat: quic-go v0.51.0 (wip) --- app/go.mod | 6 +++--- app/go.sum | 6 ++---- core/client/client.go | 22 +++++++++++++--------- core/go.mod | 6 +++--- core/go.sum | 4 ++-- extras/go.mod | 6 +++--- extras/go.sum | 6 ++---- go.work | 4 ++-- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/go.mod b/app/go.mod index 8bd01dd..be67c49 100644 --- a/app/go.mod +++ b/app/go.mod @@ -1,8 +1,8 @@ module github.com/apernet/hysteria/app/v2 -go 1.22 +go 1.23 -toolchain go1.23.2 +toolchain go1.24.2 require ( github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f @@ -30,7 +30,7 @@ require ( require ( github.com/andybalholm/brotli v1.1.0 // indirect - github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 // indirect + github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c // indirect github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 // indirect github.com/cloudflare/circl v1.3.9 // indirect github.com/database64128/netx-go v0.0.0-20240905055117-62795b8b054a // indirect diff --git a/app/go.sum b/app/go.sum index 85c45a7..2e988eb 100644 --- a/app/go.sum +++ b/app/go.sum @@ -42,8 +42,8 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1 github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f h1:uVh0qpEslrWjgzx9vOcyCqsOY3c9kofDZ1n+qaw35ZY= github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f/go.mod h1:xkkq9D4ygcldQQhKS/w9CadiCKwCngU7K9E3DaKahpM= -github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 h1:oc6//C91pY9gGOBioHeyJrmmpKv/nS8fvTeDpKNPLnI= -github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0/go.mod h1:/mMPNt1MHqduzaVB2qFHnJwam3BR5r5b35GvYouJs/o= +github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c h1:C3a7C/cvdMmgZ1nGc+ctPwVfWlPhcE7J2C63bmlAOD8= +github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad h1:QzQ2sKpc9o42HNRR8ukM5uMC/RzR2HgZd/Nvaqol2C0= github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad/go.mod h1:S5IydyLSN/QAfvY+r2GoomPJ6hidtXWm/Ad18sJVssk= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0= @@ -485,8 +485,6 @@ golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= diff --git a/core/client/client.go b/core/client/client.go index 91d59fd..b9ad433 100644 --- a/core/client/client.go +++ b/core/client/client.go @@ -3,6 +3,7 @@ package client import ( "context" "crypto/tls" + "errors" "net" "net/http" "net/url" @@ -221,18 +222,21 @@ func (c *clientImpl) Close() error { return nil } +var nonPermanentErrors = []error{ + quic.StreamLimitReachedError{}, +} + // wrapIfConnectionClosed checks if the error returned by quic-go -// indicates that the QUIC connection has been permanently closed, -// and if so, wraps the error with coreErrs.ClosedError. -// PITFALL: sometimes quic-go has "internal errors" that are not net.Error, -// but we still need to treat them as ClosedError. +// is recoverable (listed in nonPermanentErrors) or permanent. +// Recoverable errors are returned as-is, +// permanent ones are wrapped as ClosedError. func wrapIfConnectionClosed(err error) error { - netErr, ok := err.(net.Error) - if !ok || !netErr.Temporary() { - return coreErrs.ClosedError{Err: err} - } else { - return err + for _, e := range nonPermanentErrors { + if errors.Is(err, e) { + return err + } } + return coreErrs.ClosedError{Err: err} } type tcpConn struct { diff --git a/core/go.mod b/core/go.mod index 1eac2dc..1cd8e99 100644 --- a/core/go.mod +++ b/core/go.mod @@ -1,11 +1,11 @@ module github.com/apernet/hysteria/core/v2 -go 1.22 +go 1.23 -toolchain go1.23.2 +toolchain go1.24.2 require ( - github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 + github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c github.com/stretchr/testify v1.9.0 go.uber.org/goleak v1.2.1 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 diff --git a/core/go.sum b/core/go.sum index 33e6d03..74f0b3c 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,5 +1,5 @@ -github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 h1:oc6//C91pY9gGOBioHeyJrmmpKv/nS8fvTeDpKNPLnI= -github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0/go.mod h1:/mMPNt1MHqduzaVB2qFHnJwam3BR5r5b35GvYouJs/o= +github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c h1:C3a7C/cvdMmgZ1nGc+ctPwVfWlPhcE7J2C63bmlAOD8= +github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= diff --git a/extras/go.mod b/extras/go.mod index 1ae6146..5bda6c6 100644 --- a/extras/go.mod +++ b/extras/go.mod @@ -1,12 +1,12 @@ module github.com/apernet/hysteria/extras/v2 -go 1.22 +go 1.23 -toolchain go1.23.2 +toolchain go1.24.2 require ( github.com/apernet/hysteria/core/v2 v2.0.0-00010101000000-000000000000 - github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 + github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 github.com/database64128/tfo-go/v2 v2.2.2 github.com/hashicorp/golang-lru/v2 v2.0.5 diff --git a/extras/go.sum b/extras/go.sum index 31595de..9bbb21a 100644 --- a/extras/go.sum +++ b/extras/go.sum @@ -1,7 +1,7 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= -github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 h1:oc6//C91pY9gGOBioHeyJrmmpKv/nS8fvTeDpKNPLnI= -github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0/go.mod h1:/mMPNt1MHqduzaVB2qFHnJwam3BR5r5b35GvYouJs/o= +github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c h1:C3a7C/cvdMmgZ1nGc+ctPwVfWlPhcE7J2C63bmlAOD8= +github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6/go.mod h1:J29hk+f9lJrblVIfiJOtTFk+OblBawmib4uz/VdKzlg= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -107,8 +107,6 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= diff --git a/go.work b/go.work index 1ff4f48..1d4fa8b 100644 --- a/go.work +++ b/go.work @@ -1,6 +1,6 @@ -go 1.22 +go 1.23 -toolchain go1.23.2 +toolchain go1.24.2 use ( ./app From c2c4a9545ec5801aab7ce55e19b202229e46461c Mon Sep 17 00:00:00 2001 From: Toby Date: Sun, 20 Apr 2025 14:27:45 -0700 Subject: [PATCH 4/7] fix: broken cc after connection migration --- app/go.mod | 2 +- app/go.sum | 4 ++-- core/go.mod | 2 +- core/go.sum | 4 ++-- extras/go.mod | 2 +- extras/go.sum | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/go.mod b/app/go.mod index be67c49..d8a68a2 100644 --- a/app/go.mod +++ b/app/go.mod @@ -30,7 +30,7 @@ require ( require ( github.com/andybalholm/brotli v1.1.0 // indirect - github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c // indirect + github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a // indirect github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 // indirect github.com/cloudflare/circl v1.3.9 // indirect github.com/database64128/netx-go v0.0.0-20240905055117-62795b8b054a // indirect diff --git a/app/go.sum b/app/go.sum index 2e988eb..bbacee8 100644 --- a/app/go.sum +++ b/app/go.sum @@ -42,8 +42,8 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1 github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f h1:uVh0qpEslrWjgzx9vOcyCqsOY3c9kofDZ1n+qaw35ZY= github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f/go.mod h1:xkkq9D4ygcldQQhKS/w9CadiCKwCngU7K9E3DaKahpM= -github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c h1:C3a7C/cvdMmgZ1nGc+ctPwVfWlPhcE7J2C63bmlAOD8= -github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= +github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a h1:3UksCgxkac5L2hSbs3rZZVIOSX0EMQEg3K0HtTCoois= +github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad h1:QzQ2sKpc9o42HNRR8ukM5uMC/RzR2HgZd/Nvaqol2C0= github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad/go.mod h1:S5IydyLSN/QAfvY+r2GoomPJ6hidtXWm/Ad18sJVssk= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0= diff --git a/core/go.mod b/core/go.mod index 1cd8e99..68eed04 100644 --- a/core/go.mod +++ b/core/go.mod @@ -5,7 +5,7 @@ go 1.23 toolchain go1.24.2 require ( - github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c + github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a github.com/stretchr/testify v1.9.0 go.uber.org/goleak v1.2.1 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 diff --git a/core/go.sum b/core/go.sum index 74f0b3c..957f4c5 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,5 +1,5 @@ -github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c h1:C3a7C/cvdMmgZ1nGc+ctPwVfWlPhcE7J2C63bmlAOD8= -github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= +github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a h1:3UksCgxkac5L2hSbs3rZZVIOSX0EMQEg3K0HtTCoois= +github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= diff --git a/extras/go.mod b/extras/go.mod index 5bda6c6..19f1ffc 100644 --- a/extras/go.mod +++ b/extras/go.mod @@ -6,7 +6,7 @@ toolchain go1.24.2 require ( github.com/apernet/hysteria/core/v2 v2.0.0-00010101000000-000000000000 - github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c + github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 github.com/database64128/tfo-go/v2 v2.2.2 github.com/hashicorp/golang-lru/v2 v2.0.5 diff --git a/extras/go.sum b/extras/go.sum index 9bbb21a..8457569 100644 --- a/extras/go.sum +++ b/extras/go.sum @@ -1,7 +1,7 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= -github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c h1:C3a7C/cvdMmgZ1nGc+ctPwVfWlPhcE7J2C63bmlAOD8= -github.com/apernet/quic-go v0.51.1-0.20250420202007-25ded0c7e74c/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= +github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a h1:3UksCgxkac5L2hSbs3rZZVIOSX0EMQEg3K0HtTCoois= +github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6/go.mod h1:J29hk+f9lJrblVIfiJOtTFk+OblBawmib4uz/VdKzlg= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= From aa5f68a6f7c436b8891a2f2e0b185f13e8312c0d Mon Sep 17 00:00:00 2001 From: Toby Date: Sun, 20 Apr 2025 14:33:40 -0700 Subject: [PATCH 5/7] chore: update go version to 1.24 in workflows --- .github/workflows/master.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 2b852fc..e5689e7 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.24" - name: Setup Python # This is for the build script uses: actions/setup-python@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7a2433..a966d86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.24" - name: Setup Python # This is for the build script uses: actions/setup-python@v5 From 3a9e952af088649016a595d754964a61a2296279 Mon Sep 17 00:00:00 2001 From: Haruue Date: Tue, 27 May 2025 18:27:54 +0900 Subject: [PATCH 6/7] fix(client): remove share uri in log close: #1355 Since we already have the "share" subcommand, this feature is unnecessary for the "client" subcommand. This commit disables printing the share URI after the client starts, but keeps this behavior for users who specified the `--qr` flag (who may still rely on it) and shows a deprecation warning. --- app/cmd/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/cmd/client.go b/app/cmd/client.go index 65bc7e0..05fec80 100644 --- a/app/cmd/client.go +++ b/app/cmd/client.go @@ -470,8 +470,10 @@ func runClient(cmd *cobra.Command, args []string) { defer c.Close() uri := config.URI() - logger.Info("use this URI to share your server", zap.String("uri", uri)) if showQR { + logger.Warn("--qr flag is deprecated and will be removed in future release, " + + "please use `share` subcommand to generate share URI and QR code") + logger.Info("use this URI to share your server", zap.String("uri", uri)) utils.PrintQR(uri) } From b5ddcb5bc49cdee6a2c58084e6afff4063748b3a Mon Sep 17 00:00:00 2001 From: Toby Date: Sat, 7 Jun 2025 11:59:30 -0700 Subject: [PATCH 7/7] feat: quic-go v0.52.0 --- app/go.mod | 2 +- app/go.sum | 4 ++-- core/client/client.go | 1 + core/go.mod | 2 +- core/go.sum | 4 ++-- core/server/server.go | 1 + extras/go.mod | 2 +- extras/go.sum | 4 ++-- 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/go.mod b/app/go.mod index d8a68a2..25d1fd3 100644 --- a/app/go.mod +++ b/app/go.mod @@ -30,7 +30,7 @@ require ( require ( github.com/andybalholm/brotli v1.1.0 // indirect - github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a // indirect + github.com/apernet/quic-go v0.52.1-0.20250607183305-9320c9d14431 // indirect github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 // indirect github.com/cloudflare/circl v1.3.9 // indirect github.com/database64128/netx-go v0.0.0-20240905055117-62795b8b054a // indirect diff --git a/app/go.sum b/app/go.sum index bbacee8..9bc7ae7 100644 --- a/app/go.sum +++ b/app/go.sum @@ -42,8 +42,8 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1 github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f h1:uVh0qpEslrWjgzx9vOcyCqsOY3c9kofDZ1n+qaw35ZY= github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f/go.mod h1:xkkq9D4ygcldQQhKS/w9CadiCKwCngU7K9E3DaKahpM= -github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a h1:3UksCgxkac5L2hSbs3rZZVIOSX0EMQEg3K0HtTCoois= -github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= +github.com/apernet/quic-go v0.52.1-0.20250607183305-9320c9d14431 h1:9/jM7e+kVALd7Jfu1c27dcEpT/Fd/Gzq2OsQjKjakKI= +github.com/apernet/quic-go v0.52.1-0.20250607183305-9320c9d14431/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad h1:QzQ2sKpc9o42HNRR8ukM5uMC/RzR2HgZd/Nvaqol2C0= github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad/go.mod h1:S5IydyLSN/QAfvY+r2GoomPJ6hidtXWm/Ad18sJVssk= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0= diff --git a/core/client/client.go b/core/client/client.go index b9ad433..3691d1e 100644 --- a/core/client/client.go +++ b/core/client/client.go @@ -84,6 +84,7 @@ func (c *clientImpl) connect() (*HandshakeInfo, error) { KeepAlivePeriod: c.config.QUICConfig.KeepAlivePeriod, DisablePathMTUDiscovery: c.config.QUICConfig.DisablePathMTUDiscovery, EnableDatagrams: true, + DisablePathManager: true, } // Prepare RoundTripper var conn quic.EarlyConnection diff --git a/core/go.mod b/core/go.mod index 68eed04..a6ba575 100644 --- a/core/go.mod +++ b/core/go.mod @@ -5,7 +5,7 @@ go 1.23 toolchain go1.24.2 require ( - github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a + github.com/apernet/quic-go v0.52.1-0.20250607183305-9320c9d14431 github.com/stretchr/testify v1.9.0 go.uber.org/goleak v1.2.1 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 diff --git a/core/go.sum b/core/go.sum index 957f4c5..f44407d 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,5 +1,5 @@ -github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a h1:3UksCgxkac5L2hSbs3rZZVIOSX0EMQEg3K0HtTCoois= -github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= +github.com/apernet/quic-go v0.52.1-0.20250607183305-9320c9d14431 h1:9/jM7e+kVALd7Jfu1c27dcEpT/Fd/Gzq2OsQjKjakKI= +github.com/apernet/quic-go v0.52.1-0.20250607183305-9320c9d14431/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= diff --git a/core/server/server.go b/core/server/server.go index 696f1d0..89645e0 100644 --- a/core/server/server.go +++ b/core/server/server.go @@ -43,6 +43,7 @@ func NewServer(config *Config) (Server, error) { MaxIncomingStreams: config.QUICConfig.MaxIncomingStreams, DisablePathMTUDiscovery: config.QUICConfig.DisablePathMTUDiscovery, EnableDatagrams: true, + DisablePathManager: true, } listener, err := quic.Listen(config.Conn, tlsConfig, quicConfig) if err != nil { diff --git a/extras/go.mod b/extras/go.mod index 19f1ffc..23b060a 100644 --- a/extras/go.mod +++ b/extras/go.mod @@ -6,7 +6,7 @@ toolchain go1.24.2 require ( github.com/apernet/hysteria/core/v2 v2.0.0-00010101000000-000000000000 - github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a + github.com/apernet/quic-go v0.52.1-0.20250607183305-9320c9d14431 github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 github.com/database64128/tfo-go/v2 v2.2.2 github.com/hashicorp/golang-lru/v2 v2.0.5 diff --git a/extras/go.sum b/extras/go.sum index 8457569..ac6d04a 100644 --- a/extras/go.sum +++ b/extras/go.sum @@ -1,7 +1,7 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= -github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a h1:3UksCgxkac5L2hSbs3rZZVIOSX0EMQEg3K0HtTCoois= -github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= +github.com/apernet/quic-go v0.52.1-0.20250607183305-9320c9d14431 h1:9/jM7e+kVALd7Jfu1c27dcEpT/Fd/Gzq2OsQjKjakKI= +github.com/apernet/quic-go v0.52.1-0.20250607183305-9320c9d14431/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6/go.mod h1:J29hk+f9lJrblVIfiJOtTFk+OblBawmib4uz/VdKzlg= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=