mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-08-05 06:31:05 -04:00
unified drain support for vmess and shadowsockets
This commit is contained in:
@@ -6,6 +6,9 @@ package outbound
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"hash/crc64"
|
||||
"time"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
@@ -128,7 +131,12 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
||||
isAEAD = true
|
||||
}
|
||||
|
||||
session := encoding.NewClientSession(ctx, isAEAD, protocol.DefaultIDHash)
|
||||
hashkdf := hmac.New(sha256.New, []byte("VMessBF"))
|
||||
hashkdf.Write(account.ID.Bytes())
|
||||
|
||||
behaviorSeed := crc64.Checksum(hashkdf.Sum(nil), crc64.MakeTable(crc64.ISO))
|
||||
|
||||
session := encoding.NewClientSession(ctx, isAEAD, protocol.DefaultIDHash, int64(behaviorSeed))
|
||||
sessionPolicy := h.policyManager.ForLevel(request.User.Level)
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
|
||||
Reference in New Issue
Block a user