feat: Integrate UoT support in inbound and outbound handling

This commit is contained in:
n3t1zen
2026-02-26 10:40:25 +08:00
parent 72956fb4f4
commit 13754f26e4
2 changed files with 26 additions and 26 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/sagernet/sing-box/common/listener"
"github.com/sagernet/sing-box/common/mux"
boxTLS "github.com/sagernet/sing-box/common/tls"
"github.com/sagernet/sing-box/common/uot"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
@@ -44,7 +45,7 @@ type Inbound struct {
func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.MySQLInboundOptions) (adapter.Inbound, error) {
inbound := &Inbound{
Adapter: inbound.NewAdapter(C.TypeMySQL, tag),
router: router,
router: uot.NewRouter(router, logger),
logger: logger,
identityProvider: server.NewInMemoryProvider(),
}
@@ -197,7 +198,7 @@ func (h *Inbound) handleMuxStream0(ctx context.Context, conn net.Conn, source M.
h.router.RouteConnectionEx(ctx, conn, metadata, nil)
case commandUDP:
metadata.Destination = destination
h.logger.InfoContext(ctx, "inbound packet connection to ", metadata.Destination)
h.logger.InfoContext(ctx, "inbound UoT packet connection to ", metadata.Destination)
h.router.RouteConnectionEx(ctx, conn, metadata, nil)
default:
return E.New("unknown command ", command)