1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-03 15:55:20 -05:00

merge user info inbound metadata

This commit is contained in:
Darien Raymond
2018-10-15 08:36:50 +02:00
parent e35e3e6e53
commit 595f3d685e
8 changed files with 42 additions and 26 deletions

View File

@@ -8,7 +8,6 @@ import (
"v2ray.com/core/app/dispatcher"
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol"
"v2ray.com/core/common/strmatcher"
"v2ray.com/core/proxy"
)
@@ -282,7 +281,12 @@ func NewUserMatcher(users []string) *UserMatcher {
}
func (v *UserMatcher) Apply(ctx context.Context) bool {
user := protocol.UserFromContext(ctx)
inbound := session.InboundFromContext(ctx)
if inbound == nil {
return false
}
user := inbound.User
if user == nil {
return false
}