From 34765dd682b77c78ef1134b893aec1f0241f16cb Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Wed, 13 Mar 2024 15:42:27 +0800 Subject: [PATCH] Add backoff to schedialer --- chain/chain.go | 2 ++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/chain/chain.go b/chain/chain.go index 1ba9ee3..b144a7b 100644 --- a/chain/chain.go +++ b/chain/chain.go @@ -11,6 +11,7 @@ import ( "github.com/wzshiming/bridge/internal/scheme" "github.com/wzshiming/geario" "github.com/wzshiming/schedialer" + "github.com/wzshiming/schedialer/plugins/backoff" "github.com/wzshiming/schedialer/plugins/flow" "github.com/wzshiming/schedialer/plugins/probe" "github.com/wzshiming/schedialer/plugins/random" @@ -84,6 +85,7 @@ func (b *BridgeChain) Dial(dialer bridge.Dialer, addresses []string, probeUrl st return b.dialOne(dialer, addresses[0]) } plugins := []schedialer.Plugin{ + backoff.NewBackoff(), random.NewRandom(1), flow.NewFlow(40), rate.NewRate(40), diff --git a/go.mod b/go.mod index 88be3d1..fc17a07 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/wzshiming/httpproxy v0.5.5 github.com/wzshiming/notify v0.1.1 github.com/wzshiming/permuteproxy v0.0.2 - github.com/wzshiming/schedialer v0.3.0 + github.com/wzshiming/schedialer v0.4.0 github.com/wzshiming/shadowsocks v0.4.0 github.com/wzshiming/socks4 v0.3.2 github.com/wzshiming/socks5 v0.4.3 diff --git a/go.sum b/go.sum index 2619c25..64a61f5 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,8 @@ github.com/wzshiming/notify v0.1.1 h1:rJXoszrkNglhCVyn/IfW500f5cW03q1q7YzL8hsLch github.com/wzshiming/notify v0.1.1/go.mod h1:SFhsQKZJznzsDcj/Qfo9A65k5IRcpUrpgbLRzZEa/DI= github.com/wzshiming/permuteproxy v0.0.2 h1:svedMueotlxJk9oJfA0gs8WzRYOdgd0DER9XvKpjwlY= github.com/wzshiming/permuteproxy v0.0.2/go.mod h1:Ny08A1JbuljB8FeJAOiB7dfvRGCVD8PB9hwrALIvYI8= -github.com/wzshiming/schedialer v0.3.0 h1:dVdg20s5HsRKcOM7psO0eCsXaD/w+tCXaQmm92M6/04= -github.com/wzshiming/schedialer v0.3.0/go.mod h1:TvVxg4QZIBTJzRfmL/G7g6CzynFQKPmtXtSeJ2c4Lus= +github.com/wzshiming/schedialer v0.4.0 h1:BH77oM4ViOqxxtokMhvq1uKSFTTPnIapylXjM4hQLlM= +github.com/wzshiming/schedialer v0.4.0/go.mod h1:TvVxg4QZIBTJzRfmL/G7g6CzynFQKPmtXtSeJ2c4Lus= github.com/wzshiming/shadowsocks v0.4.0 h1:Yi+4J/DK15qdKlssNEMoWjtmc8wyY8ByIBbC5Ft29bQ= github.com/wzshiming/shadowsocks v0.4.0/go.mod h1:xYRRSKR+hTihSDUOE+evavx0wkLVODTWVXEcz5vosoE= github.com/wzshiming/socks4 v0.3.2 h1:w87nwfgRWteVwIH39nqTur8c+2dcODeLgLrWspcUkSc=