diff --git a/proxy/vless/encoding/addons.go b/proxy/vless/encoding/addons.go index c6fdfcae88e..b35e609eb77 100644 --- a/proxy/vless/encoding/addons.go +++ b/proxy/vless/encoding/addons.go @@ -76,7 +76,7 @@ func DecodeHeaderAddons(buffer *buf.Buffer, reader io.Reader) (*Addons, error) { func EncodeBodyAddons(writer io.Writer, request *protocol.RequestHeader, addons *Addons) buf.Writer { switch addons.Flow { - case vless.XRO: + default: if request.Command == protocol.RequestCommandUDP { return NewMultiLengthPacketWriter(writer.(buf.Writer)) @@ -92,7 +92,7 @@ func EncodeBodyAddons(writer io.Writer, request *protocol.RequestHeader, addons func DecodeBodyAddons(reader io.Reader, request *protocol.RequestHeader, addons *Addons) buf.Reader { switch addons.Flow { - case vless.XRO: + default: if request.Command == protocol.RequestCommandUDP { return NewLengthPacketReader(reader) @@ -197,7 +197,7 @@ func (r *LengthPacketReader) ReadMultiBuffer() (buf.MultiBuffer, error) { mb := make(buf.MultiBuffer, 0, length/buf.Size+1) for length > 0 { size := length - if length > buf.Size { + if size > buf.Size { size = buf.Size } length -= size diff --git a/proxy/vless/inbound/inbound.go b/proxy/vless/inbound/inbound.go index af7ded4f4c2..803fce33fff 100644 --- a/proxy/vless/inbound/inbound.go +++ b/proxy/vless/inbound/inbound.go @@ -386,7 +386,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i account := request.User.Account.(*vless.MemoryAccount) responseAddons := &encoding.Addons{ - Flow: requestAddons.Flow, + //Flow: requestAddons.Flow, } switch requestAddons.Flow { @@ -396,7 +396,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i case protocol.RequestCommandMux: return newError(vless.XRO + " doesn't support Mux").AtWarning() case protocol.RequestCommandUDP: - //return newError(vless.XRO + " doesn't support UDP").AtWarning() + return newError(vless.XRO + " doesn't support UDP").AtWarning() case protocol.RequestCommandTCP: if xtlsConn, ok := iConn.(*xtls.Conn); ok { xtlsConn.RPRX = true diff --git a/proxy/vless/outbound/outbound.go b/proxy/vless/outbound/outbound.go index a1d6726c1c4..3be02778345 100644 --- a/proxy/vless/outbound/outbound.go +++ b/proxy/vless/outbound/outbound.go @@ -135,7 +135,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte if requestAddons.Flow == vless.XRO && request.Port == 443 { return newError(vless.XRO + " stopped UDP/443").AtWarning() } - requestAddons.Flow = vless.XRO + requestAddons.Flow = "" case protocol.RequestCommandTCP: if xtlsConn, ok := iConn.(*xtls.Conn); ok { xtlsConn.RPRX = true