mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 01:08:33 +00:00
XTLS Vision: Apply padding to single XUDP by default at client side
Requires Xray-core v1.8.1+ at server side: 242f3b0e0b
This commit is contained in:
parent
dd635c7c8d
commit
ad3d347cfc
4 changed files with 12 additions and 10 deletions
|
@ -62,11 +62,7 @@ func DecodeHeaderAddons(buffer *buf.Buffer, reader io.Reader) (*Addons, error) {
|
|||
// EncodeBodyAddons returns a Writer that auto-encrypt content written by caller.
|
||||
func EncodeBodyAddons(writer io.Writer, request *protocol.RequestHeader, requestAddons *Addons, state *proxy.TrafficState, context context.Context) buf.Writer {
|
||||
if request.Command == protocol.RequestCommandUDP {
|
||||
w := writer.(buf.Writer)
|
||||
if requestAddons.Flow == vless.XRV {
|
||||
w = proxy.NewVisionWriter(w, state, context)
|
||||
}
|
||||
return NewMultiLengthPacketWriter(w)
|
||||
return NewMultiLengthPacketWriter(writer.(buf.Writer))
|
||||
}
|
||||
w := buf.NewWriter(writer)
|
||||
if requestAddons.Flow == vless.XRV {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue