feat: Integrate UoT support in inbound and outbound handling
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user