SS2022 proxy: Refinements & fixes (#7488)

https://github.com/XTLS/Xray-core/pull/7194#issuecomment-6250856095

Closes https://github.com/XTLS/Xray-core/issues/7486

---------

Co-authored-by: Roman Rublev <roman171107@gmail.com>
This commit is contained in:
风扇滑翔翼
2026-11-26 21:09:53 +00:00
committed by GitHub
co-authored by Roman Rublev
parent 67756b3674
commit db6664bd68
10 changed files with 381 additions and 271 deletions
+9 -3
View File
@@ -63,10 +63,16 @@ func (s *ServerUDPSession) EnsureLink(
s.currentConn.Store(conn)
sessCtx, cancel := context.WithCancel(ctx)
// UDP Session might travel across multiple connections
// don't bind its lifetime to a parent context
sessCtx, cancel := context.WithCancel(context.WithoutCancel(ctx))
inbound := session.InboundFromContext(sessCtx)
if inbound != nil && s.User != nil {
inbound.User = s.User
if inbound != nil {
newInbound := *inbound
if s.User != nil {
newInbound.User = s.User
}
sessCtx = session.ContextWithInbound(sessCtx, &newInbound)
}
var email string
var level uint32