mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-01 07:57:14 +00:00
feat(xhttp): default xmux maxConnections to 6
xray-core v26.6.27 changed the XHTTP client xmux default to maxConnections=6 (anti-RKN). The panel previously sent maxConnections=0, which overrode that default; default XHttpXmuxSchema to 6 so new outbounds adopt it and the wire-exclusivity rule drops maxConcurrency accordingly.
This commit is contained in:
@@ -17,7 +17,7 @@ export type XHttpMode = z.infer<typeof XHttpModeSchema>;
|
|||||||
// are strings because they accept dash-range values like '16-32'.
|
// are strings because they accept dash-range values like '16-32'.
|
||||||
export const XHttpXmuxSchema = z.object({
|
export const XHttpXmuxSchema = z.object({
|
||||||
maxConcurrency: z.string().default('16-32'),
|
maxConcurrency: z.string().default('16-32'),
|
||||||
maxConnections: z.union([z.string(), z.number()]).default(0),
|
maxConnections: z.union([z.string(), z.number()]).default(6),
|
||||||
cMaxReuseTimes: z.union([z.string(), z.number()]).default(0),
|
cMaxReuseTimes: z.union([z.string(), z.number()]).default(0),
|
||||||
hMaxRequestTimes: z.string().default('600-900'),
|
hMaxRequestTimes: z.string().default('600-900'),
|
||||||
hMaxReusableSecs: z.string().default('1800-3000'),
|
hMaxReusableSecs: z.string().default('1800-3000'),
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
} from '@/lib/xray/stream-wire-normalize';
|
} from '@/lib/xray/stream-wire-normalize';
|
||||||
import { InboundFormSchema } from '@/schemas/forms/inbound-form';
|
import { InboundFormSchema } from '@/schemas/forms/inbound-form';
|
||||||
import type { InboundFormValues } from '@/schemas/forms/inbound-form';
|
import type { InboundFormValues } from '@/schemas/forms/inbound-form';
|
||||||
|
import { XHttpXmuxSchema } from '@/schemas/protocols/stream/xhttp';
|
||||||
|
|
||||||
describe('validateRealityTarget', () => {
|
describe('validateRealityTarget', () => {
|
||||||
it('accepts host:port and bare port', () => {
|
it('accepts host:port and bare port', () => {
|
||||||
@@ -150,6 +151,21 @@ describe('normalizeXhttpForWire stream-one', () => {
|
|||||||
expect(xmux).not.toHaveProperty('maxConcurrency');
|
expect(xmux).not.toHaveProperty('maxConcurrency');
|
||||||
expect(xmux.maxConnections).toBe('8');
|
expect(xmux.maxConnections).toBe('8');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('defaults xmux maxConnections to 6 (xray-core anti-RKN default) and drops maxConcurrency on the wire', () => {
|
||||||
|
expect(XHttpXmuxSchema.parse({}).maxConnections).toBe(6);
|
||||||
|
|
||||||
|
const out = normalizeXhttpForWire({
|
||||||
|
path: '/app',
|
||||||
|
mode: 'stream-one',
|
||||||
|
enableXmux: true,
|
||||||
|
xmux: XHttpXmuxSchema.parse({}),
|
||||||
|
}, 'outbound');
|
||||||
|
|
||||||
|
const xmux = out.xmux as Record<string, unknown>;
|
||||||
|
expect(xmux.maxConnections).toBe(6);
|
||||||
|
expect(xmux).not.toHaveProperty('maxConcurrency');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('normalizeSockoptForWire', () => {
|
describe('normalizeSockoptForWire', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user