add port range support for service

This commit is contained in:
ginuerzh
2024-07-08 22:38:21 +08:00
parent 96f4d7bf5c
commit c1d0887a9b
73 changed files with 1915 additions and 316 deletions

View File

@ -33,7 +33,6 @@ type tapHandler struct {
routes sync.Map
exit chan struct{}
cipher core.Cipher
router *chain.Router
md metadata
options handler.Options
}
@ -64,11 +63,6 @@ func (h *tapHandler) Init(md md.Metadata) (err error) {
}
}
h.router = h.options.Router
if h.router == nil {
h.router = chain.NewRouter(chain.LoggerRouterOption(h.options.Logger))
}
return
}
@ -135,7 +129,7 @@ func (h *tapHandler) handleLoop(ctx context.Context, conn net.Conn, addr net.Add
var pc net.PacketConn
if addr != nil {
cc, err := h.router.Dial(ctx, addr.Network(), "")
cc, err := h.options.Router.Dial(ctx, addr.Network(), "")
if err != nil {
return err
}