From d21deda2182f5a7848d35d7d48a6e9d147a374b3 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Sat, 22 Feb 2025 13:51:12 +0100 Subject: [PATCH] fix outbound context #492 --- core/endpoint.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/endpoint.go b/core/endpoint.go index d3c3a3c..5e7f581 100644 --- a/core/endpoint.go +++ b/core/endpoint.go @@ -4,6 +4,7 @@ import ( "s-ui/logger" "s-ui/util/common" + "github.com/sagernet/sing-box/adapter" "github.com/sagernet/sing-box/option" ) @@ -52,8 +53,12 @@ func (c *Core) AddOutbound(config []byte) error { return err } + outboundCtx := adapter.WithContext(c.GetCtx(), &adapter.InboundContext{ + Outbound: outbound_config.Tag, + }) + err = outbound_manager.Create( - globalCtx, + outboundCtx, router, factory.NewLogger("outbound/"+outbound_config.Type+"["+outbound_config.Tag+"]"), outbound_config.Tag,