mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-02 17:58:46 +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:
@@ -246,7 +246,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
||||
|
||||
var userSentID []byte // not MemoryAccount.ID
|
||||
var request *protocol.RequestHeader
|
||||
var requestAddons *encoding.Addons
|
||||
var requestAddons *proxy.Addons
|
||||
var err error
|
||||
|
||||
napfb := h.fallbacks
|
||||
@@ -487,7 +487,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)
|
||||
@@ -557,13 +557,13 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
||||
}
|
||||
|
||||
trafficState := proxy.NewTrafficState(userSentID, account.Flow)
|
||||
clientReader := encoding.DecodeBodyAddons(reader, request, requestAddons, trafficState, true, ctx, connection, input, rawInput, nil)
|
||||
clientReader := encoding.DecodeBodyAddons(reader, request, responseAddons, trafficState, true, ctx, connection, input, rawInput, nil)
|
||||
|
||||
bufferWriter := buf.NewBufferedWriter(buf.NewWriter(connection))
|
||||
if err := encoding.EncodeResponseHeader(bufferWriter, request, responseAddons); err != nil {
|
||||
return errors.New("failed to encode response header").Base(err).AtWarning()
|
||||
}
|
||||
clientWriter := encoding.EncodeBodyAddons(bufferWriter, request, requestAddons, trafficState, false, ctx, connection, nil)
|
||||
clientWriter := encoding.EncodeBodyAddons(bufferWriter, request, responseAddons, trafficState, false, ctx, connection, nil)
|
||||
bufferWriter.SetFlushNext()
|
||||
|
||||
if err := dispatcher.DispatchLink(ctx, request.Destination(), &transport.Link{
|
||||
|
||||
Reference in New Issue
Block a user