From b7b422139684afa499337e5073339cf6b3a8b83b Mon Sep 17 00:00:00 2001 From: Muhammed Efe Cetin Date: Wed, 19 Feb 2025 18:01:29 +0300 Subject: [PATCH 1/2] fix rules are not applied --- config.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/config.go b/config.go index 79f8cd2..5704690 100644 --- a/config.go +++ b/config.go @@ -3,6 +3,14 @@ package redirector import ( "crypto/tls" "crypto/x509" + "fmt" + "net" + "net/http" + "net/url" + "strings" + "sync" + "time" + "github.com/armbian/redirector/db" lru "github.com/hashicorp/golang-lru" "github.com/oschwald/maxminddb-golang" @@ -11,12 +19,6 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/samber/lo" log "github.com/sirupsen/logrus" - "net" - "net/http" - "net/url" - "strings" - "sync" - "time" ) // Config represents our application's configuration. @@ -281,6 +283,7 @@ func (r *Redirector) addServer(server ServerConfig, u *url.URL) (*Server, error) Continent: server.Continent, Weight: server.Weight, Protocols: []string{"http", "https"}, + Rules: server.Rules, } if len(server.Protocols) > 0 { From 8af32290a3ec0ac242d8552838fbe1003a04a49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Efe=20=C3=87etin?= Date: Wed, 19 Feb 2025 18:20:30 +0300 Subject: [PATCH 2/2] Update config.go --- config.go | 1 - 1 file changed, 1 deletion(-) diff --git a/config.go b/config.go index 5704690..ed19f76 100644 --- a/config.go +++ b/config.go @@ -3,7 +3,6 @@ package redirector import ( "crypto/tls" "crypto/x509" - "fmt" "net" "net/http" "net/url"