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 committed 2026-06-12 01:50:37 +02:00
1 parent 7e87b7dc60
commit 60da6bed15
10 files changed
+44 -13

No files matched your search

+1
View File
@@ -8,3 +8,4 @@ DockerEntrypoint.sh text eol=lf
# with core.autocrlf=true doesn't show phantom CRLF-only "modified" diffs.
frontend/src/generated/** text eol=lf
frontend/public/openapi.json text eol=lf
frontend\src\test\__snapshots__\** text eol=lf
+7 -1
View File
@@ -59,9 +59,15 @@ function buildXhttpExtra(xhttp: XHttpStreamSettings | undefined): Record<string,
'uplinkDataKey',
'scMaxEachPostBytes',
] as const;
// Values matching xray-core's own defaults stay off the wire — old panels
// seeded them into every config and the literal values are a DPI
// fingerprint (#5141). Mirrors the sub service's filter.
const coreDefaults: Partial<Record<(typeof stringFields)[number], string>> = {
scMaxEachPostBytes: '1000000',
};
for (const k of stringFields) {
const v = xhttp[k];
if (typeof v === 'string' && v.length > 0) extra[k] = v;
if (typeof v === 'string' && v.length > 0 && v !== coreDefaults[k]) extra[k] = v;
}
// Headers on the wire are a record; emit them as a map upstream's
@@ -114,7 +114,7 @@ function buildStream(network: string, security: string): Raw {
case 'xhttp':
stream.xhttpSettings = {
path: '/', host: '', mode: 'auto', headers: {},
xPaddingBytes: '100-1000', scMaxEachPostBytes: '1000000',
xPaddingBytes: '100-1000',
};
break;
default:
Loaded 3 of 10 files, more files were not shown because too many files have changed in this diff. Show more