diff --git a/hysteria2/service_packet.go b/hysteria2/service_packet.go index d15d619..a0482bc 100644 --- a/hysteria2/service_packet.go +++ b/hysteria2/service_packet.go @@ -2,6 +2,7 @@ package hysteria2 import ( "github.com/sagernet/sing/common" + "github.com/sagernet/sing/common/auth" E "github.com/sagernet/sing/common/exceptions" M "github.com/sagernet/sing/common/metadata" ) @@ -37,7 +38,7 @@ func (s *serverSession[U]) handleUDPMessage(message *udpMessage) { udpConn, loaded := s.udpConnMap[message.sessionID] s.udpAccess.RUnlock() if !loaded || common.Done(udpConn.ctx) { - udpConn = newUDPPacketConn(s.ctx, s.quicConn, func() { + udpConn = newUDPPacketConn(auth.ContextWithUser(s.ctx, s.authUser), s.quicConn, func() { s.udpAccess.Lock() delete(s.udpConnMap, message.sessionID) s.udpAccess.Unlock() diff --git a/tuic/service_packet.go b/tuic/service_packet.go index c1bca31..9ddbfac 100644 --- a/tuic/service_packet.go +++ b/tuic/service_packet.go @@ -2,6 +2,7 @@ package tuic import ( "github.com/sagernet/sing/common" + "github.com/sagernet/sing/common/auth" E "github.com/sagernet/sing/common/exceptions" M "github.com/sagernet/sing/common/metadata" ) @@ -55,7 +56,7 @@ func (s *serverSession[U]) handleUDPMessage(message *udpMessage, udpStream bool) udpConn, loaded := s.udpConnMap[message.sessionID] s.udpAccess.RUnlock() if !loaded || common.Done(udpConn.ctx) { - udpConn = newUDPPacketConn(s.ctx, s.quicConn, udpStream, true, func() { + udpConn = newUDPPacketConn(auth.ContextWithUser(s.ctx, s.authUser), s.quicConn, udpStream, true, func() { s.udpAccess.Lock() delete(s.udpConnMap, message.sessionID) s.udpAccess.Unlock()