mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-01 09:36:53 +00:00
fix: preserve shadow-tls in-user for snell listeners (#2934)
This commit is contained in:
1 parent
01111ffac1
commit
45ca4ae12a
2 files changed
+3
-1
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user