mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Update dependencies
- Sync with sing upstream
This commit is contained in:
parent
2096821c07
commit
71a9a6dd55
5 changed files with 54 additions and 69 deletions
|
@ -7,9 +7,9 @@ import (
|
|||
"encoding/base64"
|
||||
"strconv"
|
||||
|
||||
"github.com/sagernet/sing-shadowsocks"
|
||||
"github.com/sagernet/sing-shadowsocks/shadowaead_2022"
|
||||
C "github.com/sagernet/sing/common"
|
||||
A "github.com/sagernet/sing/common/auth"
|
||||
B "github.com/sagernet/sing/common/buf"
|
||||
"github.com/sagernet/sing/common/bufio"
|
||||
E "github.com/sagernet/sing/common/exceptions"
|
||||
|
@ -120,14 +120,13 @@ func (i *MultiUserInbound) Process(ctx context.Context, network net.Network, con
|
|||
}
|
||||
|
||||
func (i *MultiUserInbound) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error {
|
||||
userCtx := ctx.(*shadowsocks.UserContext[int])
|
||||
inbound := session.InboundFromContext(ctx)
|
||||
user := i.users[userCtx.User]
|
||||
user, _ := A.UserFromContext[User](ctx)
|
||||
inbound.User = &protocol.MemoryUser{
|
||||
Email: user.Email,
|
||||
Level: uint32(user.Level),
|
||||
}
|
||||
ctx = log.ContextWithAccessMessage(userCtx.Context, &log.AccessMessage{
|
||||
ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{
|
||||
From: metadata.Source,
|
||||
To: metadata.Destination,
|
||||
Status: log.AccessAccepted,
|
||||
|
@ -148,14 +147,13 @@ func (i *MultiUserInbound) NewConnection(ctx context.Context, conn net.Conn, met
|
|||
}
|
||||
|
||||
func (i *MultiUserInbound) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata M.Metadata) error {
|
||||
userCtx := ctx.(*shadowsocks.UserContext[int])
|
||||
inbound := session.InboundFromContext(ctx)
|
||||
user := i.users[userCtx.User]
|
||||
user, _ := A.UserFromContext[User](ctx)
|
||||
inbound.User = &protocol.MemoryUser{
|
||||
Email: user.Email,
|
||||
Level: uint32(user.Level),
|
||||
}
|
||||
ctx = log.ContextWithAccessMessage(userCtx.Context, &log.AccessMessage{
|
||||
ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{
|
||||
From: metadata.Source,
|
||||
To: metadata.Destination,
|
||||
Status: log.AccessAccepted,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue