XTLS/Xray-core · error
invalid request address
Error message
invalid request address
What it means
Semantic validation in DecodeRequestHeader: the command byte parsed, but for TCP/UDP commands the address parser failed to read a valid address/port, leaving request.Address nil. Mux/Rvs commands set fixed addresses, so this specifically means the destination encoding was malformed or unreadable.
Solutions
- Verify the client's target address format (IPv4/IPv6/domain + port)
- Check for protocol corruption from middleboxes
- Ensure the client and server VLESS versions match on address encoding
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at proxy/vless/encoding/encoding.go:126 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/201b454e49dd120a.
Report an issue: GitHub.
Appendix: source
Thrown at proxy/vless/encoding/encoding.go:126
buffer.Clear()
if _, err := buffer.ReadFullFrom(reader, 1); err != nil {
return nil, nil, nil, false, errors.New("failed to read request command").Base(err)
}
request.Command = protocol.RequestCommand(buffer.Byte(0))
switch request.Command {
case protocol.RequestCommandMux:
request.Address = net.DomainAddress("v1.mux.cool")
case protocol.RequestCommandRvs:
request.Address = net.DomainAddress("v1.rvs.cool")
case protocol.RequestCommandTCP, protocol.RequestCommandUDP:
if addr, port, err := addrParser.ReadAddressPort(&buffer, reader); err == nil {
request.Address = addr
request.Port = port
}
}
if request.Address == nil {
return nil, nil, nil, false, errors.New("invalid request address")
}
return id[:], request, requestAddons, false, nil
default:
return nil, nil, nil, isfb, errors.New("invalid request version")
}
}
// EncodeResponseHeader writes encoded response header into the given writer.
func EncodeResponseHeader(writer io.Writer, request *protocol.RequestHeader, responseAddons *Addons) error {
buffer := buf.StackNew()
defer buffer.Release()
if err := buffer.WriteByte(request.Version); err != nil {
return errors.New("failed to write response version").Base(err)
}
if err := EncodeHeaderAddons(&buffer, responseAddons); err != nil {
return errors.New("failed to encode response header addons").Base(err)View on GitHub (pinned to 7d214f8b09)