mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-31 18:25:00 +03:00
fix(panel): default TLS ALPN to http/1.1 for WebSocket transport (#6787)
* fix(panel): default TLS ALPN to http/1.1 for WebSocket transport WebSocket bootstraps over HTTP/1.1: leaving ALPN at the schema default ['h2','http/1.1'] makes the server negotiate h2 and the WS handshake fails. See issue #6782. * style(frontend): keep comments within the two-line limit * style(frontend): keep comments within the two-line limit
This commit is contained in:
@@ -894,6 +894,12 @@ export default function InboundFormModal({
|
||||
cleaned.finalmask = { ...fm, udp };
|
||||
}
|
||||
}
|
||||
/* WebSocket needs HTTP/1.1 for its handshake; the TLS default
|
||||
* ALPN ['h2','http/1.1'] makes the server negotiate h2 (see #6782). */
|
||||
if (next === 'ws' && cleaned.security === 'tls') {
|
||||
const tls = (cleaned.tlsSettings as Record<string, unknown> | undefined) ?? {};
|
||||
cleaned.tlsSettings = { ...tls, alpn: ['http/1.1'] };
|
||||
}
|
||||
setV('streamSettings', cleaned);
|
||||
};
|
||||
|
||||
|
||||
@@ -344,7 +344,8 @@ export function useSecurityActions({
|
||||
delete cleaned.tlsSettings;
|
||||
delete cleaned.realitySettings;
|
||||
if (next === 'tls') {
|
||||
cleaned.tlsSettings = createTlsSettingsWithDefaultCert();
|
||||
const network = (current.network as string | undefined) ?? '';
|
||||
cleaned.tlsSettings = createTlsSettingsWithDefaultCert(network);
|
||||
}
|
||||
if (next === 'reality') {
|
||||
const reality = RealityStreamSettingsSchema.parse({}) as Record<string, unknown>;
|
||||
|
||||
Reference in New Issue
Block a user