feat(rewriter): implement plugin-based Rewriter module with gRPC and HTTP backends

Add the first implementation of core/rewriter.Rewriter as a plugin-only
component following the bypass/admission pattern (single-value, no
RewriterObject). Includes:

- plugin/rewriter/proto/: protobuf definition with Rewrite RPC returning
  transformed data in the reply
- x/rewriter/plugin/: gRPC and HTTP plugin clients
- x/registry/rewriter.go: hot-reload-safe RewriterRegistry with wrapper
- x/config/config.go: RewriterConfig, Config.Rewriters, ServiceConfig.Rewriter
- x/config/parsing/rewriter/parse.go: config parser (plugin backends only)
- core/handler/option.go: Rewriter field + RewriterOption on handler.Options
- x/config/loader/loader.go: rewriter registration during startup
- x/config/parsing/service/parse.go: inject rewriter into handler options
This commit is contained in:
ginuerzh
2026-06-27 21:44:13 +08:00
parent fb0cf72446
commit 3b25e0317f
10 changed files with 324 additions and 8 deletions
+2 -2
View File
@@ -7,11 +7,11 @@ require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/gin-contrib/cors v1.7.2
github.com/gin-gonic/gin v1.10.1
github.com/go-gost/core v0.4.3
github.com/go-gost/core v0.5.0
github.com/go-gost/go-shadowsocks2 v0.1.3
github.com/go-gost/gosocks4 v0.1.0
github.com/go-gost/gosocks5 v0.5.0
github.com/go-gost/plugin v0.3.0
github.com/go-gost/plugin v0.4.0
github.com/go-gost/relay v0.6.1
github.com/go-gost/tls-dissector v0.2.0
github.com/go-redis/redis/v8 v8.11.5