mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-17 17:48:40 +00:00
Add seed padding logic
- Seed is decoupled with XTLS Vision, which means Seed can turn on without flow - XTLS Vision now use Seed config to configure its padding only mode
This commit is contained in:
parent
68881b531e
commit
5abdc38437
8 changed files with 632 additions and 51 deletions
|
@ -215,7 +215,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
}
|
||||
|
||||
var request *protocol.RequestHeader
|
||||
var requestAddons *encoding.Addons
|
||||
var requestAddons *proxy.Addons
|
||||
var err error
|
||||
|
||||
napfb := h.fallbacks
|
||||
|
@ -455,7 +455,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
|
||||
account := request.User.Account.(*vless.MemoryAccount)
|
||||
|
||||
responseAddons := &encoding.Addons{
|
||||
responseAddons := &proxy.Addons{
|
||||
// Flow: requestAddons.Flow,
|
||||
}
|
||||
encoding.PopulateSeed(account.Seed, responseAddons)
|
||||
|
@ -536,7 +536,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
defer timer.SetTimeout(sessionPolicy.Timeouts.DownlinkOnly)
|
||||
|
||||
// default: clientReader := reader
|
||||
clientReader := encoding.DecodeBodyAddons(reader, request, requestAddons, trafficState, true, ctx)
|
||||
clientReader := encoding.DecodeBodyAddons(reader, request, responseAddons, trafficState, true, ctx)
|
||||
|
||||
var err error
|
||||
|
||||
|
@ -564,7 +564,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
}
|
||||
|
||||
// default: clientWriter := bufferWriter
|
||||
clientWriter := encoding.EncodeBodyAddons(bufferWriter, request, requestAddons, trafficState, false, ctx)
|
||||
clientWriter := encoding.EncodeBodyAddons(bufferWriter, request, responseAddons, trafficState, false, ctx)
|
||||
multiBuffer, err1 := serverReader.ReadMultiBuffer()
|
||||
if err1 != nil {
|
||||
return err1 // ...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue