Collect stats and possible padding (previously Vision Reader Writer) to all traffic

This commit is contained in:
yuhan6665
2024-04-17 16:09:01 -04:00
parent cba71f8cdc
commit 51234fbe53
4 changed files with 20 additions and 28 deletions
+2 -5
View File
@@ -556,11 +556,8 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
ctx = session.ContextWithAllowedNetwork(ctx, net.Network_UDP)
}
trafficState := proxy.NewTrafficState(userSentID)
clientReader := encoding.DecodeBodyAddons(reader, request, requestAddons)
if requestAddons.Flow == vless.XRV {
clientReader = proxy.NewVisionReader(clientReader, trafficState, true, ctx, connection, input, rawInput, nil)
}
trafficState := proxy.NewTrafficState(userSentID, account.Flow)
clientReader := encoding.DecodeBodyAddons(reader, request, requestAddons, trafficState, true, ctx, connection, input, rawInput, nil)
bufferWriter := buf.NewBufferedWriter(buf.NewWriter(connection))
if err := encoding.EncodeResponseHeader(bufferWriter, request, responseAddons); err != nil {