fix(xhttp): stop injecting scMaxEachPostBytes/scMinPostsIntervalMs defaults (#5141)

The panel seeded xhttp configs with scMaxEachPostBytes=1000000 and
scMinPostsIntervalMs=30 — xray-core''s own defaults — and emitted them
into every generated config and share link. The literal
scMinPostsIntervalMs=30 is a stable DPI fingerprint that Russia''s TSPU
keys on to block connections on mobile networks.

New configs no longer seed these values (empty schema/template defaults,
so xray-core applies its internal defaults). For configs already stored
with the old defaults, the link/subscription builders now drop values
equal to xray-core''s defaults instead of advertising them — covering
panel share links, the raw subscription, and the JSON subscription
without requiring every inbound to be re-saved. Non-default values the
user set deliberately are still emitted.
This commit is contained in:
MHSanaei
2026-06-12 01:50:37 +02:00
parent 7e87b7dc60
commit 60da6bed15
10 changed files with 44 additions and 13 deletions
@@ -41,7 +41,10 @@ export const XHttpStreamSettingsSchema = z.object({
seqKey: z.string().default(''),
uplinkDataPlacement: z.string().default(''),
uplinkDataKey: z.string().default(''),
scMaxEachPostBytes: z.string().default('1000000'),
// Empty default on purpose: xray-core already defaults to 1MB/30ms, and
// baking the literal values into every config and share link gives DPI a
// stable fingerprint (#5141 — TSPU keys on scMinPostsIntervalMs=30).
scMaxEachPostBytes: z.string().default(''),
noSSEHeader: z.boolean().default(false),
scMaxBufferedPosts: z.number().int().min(0).default(30),
scStreamUpServerSecs: z.string().default('20-80'),
@@ -51,7 +54,7 @@ export const XHttpStreamSettingsSchema = z.object({
// Outbound-only fields. Server (inbound) listener ignores these. The
// panel embeds them in share-link `extra` blobs so the same xhttp
// config can roundtrip on both sides.
scMinPostsIntervalMs: z.string().default('30'),
scMinPostsIntervalMs: z.string().default(''),
uplinkChunkSize: z.number().int().min(0).default(0),
noGRPCHeader: z.boolean().default(false),
xmux: XHttpXmuxSchema.optional(),