VLESS protocol: Add Reverse Proxy (4) Command and extremely simple config (#5101)

https://github.com/XTLS/Xray-core/issues/5088#issuecomment-3263093341
This commit is contained in:
RPRX
2025-09-09 14:19:12 +00:00
committed by GitHub
parent a0c63ba1cf
commit 845010b535
14 changed files with 420 additions and 81 deletions

View File

@@ -46,7 +46,7 @@ func EncodeRequestHeader(writer io.Writer, request *protocol.RequestHeader, requ
return errors.New("failed to write request command").Base(err)
}
if request.Command != protocol.RequestCommandMux {
if request.Command != protocol.RequestCommandMux && request.Command != protocol.RequestCommandRvs {
if err := addrParser.WriteAddressPort(&buffer, request.Address, request.Port); err != nil {
return errors.New("failed to write request address and port").Base(err)
}
@@ -112,7 +112,8 @@ func DecodeRequestHeader(isfb bool, first *buf.Buffer, reader io.Reader, validat
switch request.Command {
case protocol.RequestCommandMux:
request.Address = net.DomainAddress("v1.mux.cool")
request.Port = 0
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