[Feature request] XHTTP: support multiple/randomized paths (`pathList`)
Problem
With XHTTP, path is a single static value on both client and server, so all traffic to a server goes to the same URL prefix. A real website doesn't serve all its traffic under one unusual path, so this constant path is an easy fingerprint for DPI/censors (e.g. TSPU in Russia).
Padding and header randomization already exist, but the path itself is never varied.
Proposal
Allow a list of paths in xhttpSettings:
"xhttpSettings": {
"path": "/default",
"pathList": ["/a/b/c", "/static/v2/app", "/api/events/stream"]
}
- Client: pick a random entry from
pathListper session (all requests sharing one session ID), and optionally per request where the mode allows it. - Server: accept every path in
pathListas a valid entry point and route it to the same XHTTP handler. Other paths behave as they do today. - Compatibility: if
pathListis unset, nothing changes. If both are set,pathis treated as one more entry in the list.
Why in the core
I currently work around this with Caddy/nginx: the subscription is regenerated every few minutes with a random path, and the reverse proxy rewrites it back to the real one (matching upstream by a header from extra.headers). This has drawbacks:
- It needs a reverse proxy and custom subscription tooling.
- The path only changes when the subscription is refreshed, not per session/request.
- Every provider has to reimplement the same logic.
Native support would work for any client built on Xray-core, with no extra infrastructure.
Open questions
- Which XHTTP modes (
packet-up,stream-up,stream-one) can safely support per-request selection, given session ID/seq are encoded in the path? - Should the server side support patterns (e.g.
/static/*/app) or only exact matches? - Top-level
xhttpSettingsfield or part ofextra(so it can be carried in share links)?
why this is needed?
路径只是一个被加密的字符串而已 外部观测不到
why this is needed?
XHTTP is commonly deployed behind a CDN, and in that setup the CDN terminates TLS. That means the path is fully visible to a third party that:
- sees every request URL in its logs and analytics,
- can apply path-based WAF rules, rate limiting, or blocking,
- can be pressured or configured to act on a specific URL.
路径只是一个被加密的字符串而已 外部观测不到
path is encrypted then provider terminate TLS, but CDN can do it too, also watch reply above. thanks.