fix: preserve shadow-tls in-user for snell listeners (#2934)

This commit is contained in:
xream authored and GitHub committed 2026-07-03 17:40:52 +08:00
1 parent 01111ffac1
commit 45ca4ae12a
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -18,6 +18,8 @@ func WithAdditions(ctx context.Context, additions ...inbound.Addition) context.C
return context.WithValue(ctx, ctxKeyAdditions, additions)
}
func AdditionsFromContext(ctx context.Context) []inbound.Addition { return getAdditions(ctx) }
func getAdditions(ctx context.Context) (additions []inbound.Addition) {
if v := ctx.Value(ctxKeyAdditions); v != nil {
if a, ok := v.([]inbound.Addition); ok {
+1 -1
View File
@@ -90,7 +90,7 @@ func New(config LC.SnellServer, lc C.InboundListenConfig, tunnel C.Tunnel, addit
WildcardSNI: wildcardSNI,
Handler: sing.FnHandler{
NewConnectionFn: func(ctx context.Context, conn net.Conn, metadata M.Metadata) error {
l.handleConn(conn, tunnel, additions...)
l.handleConn(conn, tunnel, sing.AdditionsFromContext(ctx)...)
return nil
}},
Logger: log.SingLogger,