diff options
| author | Sanaei <ho3ein.sanaei@gmail.com> | 2025-08-04 17:27:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-04 17:27:57 +0300 |
| commit | e4ba5ba53a27ee256364e7031df3d43afb3b3fe6 (patch) | |
| tree | 994de962ab65539acbc7f9802b07fa5c111795fd /web/assets/js/model/inbound.js | |
| parent | 6ff555c8bb7abf2d528363b4937757424a0ae527 (diff) | |
add ech support (#3310)
Co-authored-by: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/assets/js/model/inbound.js')
| -rw-r--r-- | web/assets/js/model/inbound.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index 09073593..da5522a5 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -560,6 +560,8 @@ class TlsStreamSettings extends XrayCommonClass { enableSessionResumption = false, certificates = [new TlsStreamSettings.Cert()], alpn = [ALPN_OPTION.H2, ALPN_OPTION.HTTP1], + echServerKeys = '', + echForceQuery = 'none', settings = new TlsStreamSettings.Settings() ) { super(); @@ -573,6 +575,8 @@ class TlsStreamSettings extends XrayCommonClass { this.enableSessionResumption = enableSessionResumption; this.certs = certificates; this.alpn = alpn; + this.echServerKeys = echServerKeys; + this.echForceQuery = echForceQuery; this.settings = settings; } @@ -592,7 +596,7 @@ class TlsStreamSettings extends XrayCommonClass { } if (!ObjectUtil.isEmpty(json.settings)) { - settings = new TlsStreamSettings.Settings(json.settings.allowInsecure, json.settings.fingerprint, json.settings.serverName, json.settings.domains); + settings = new TlsStreamSettings.Settings(json.settings.allowInsecure, json.settings.fingerprint, json.settings.echConfigList); } return new TlsStreamSettings( json.serverName, @@ -605,6 +609,8 @@ class TlsStreamSettings extends XrayCommonClass { json.enableSessionResumption, certs, json.alpn, + json.echServerKeys, + json.echForceQuery, settings, ); } @@ -621,6 +627,8 @@ class TlsStreamSettings extends XrayCommonClass { enableSessionResumption: this.enableSessionResumption, certificates: TlsStreamSettings.toJsonArray(this.certs), alpn: this.alpn, + echServerKeys: this.echServerKeys, + echForceQuery: this.echForceQuery, settings: this.settings, }; } @@ -701,21 +709,25 @@ TlsStreamSettings.Settings = class extends XrayCommonClass { constructor( allowInsecure = false, fingerprint = UTLS_FINGERPRINT.UTLS_CHROME, + echConfigList = '', ) { super(); this.allowInsecure = allowInsecure; this.fingerprint = fingerprint; + this.echConfigList = echConfigList; } static fromJson(json = {}) { return new TlsStreamSettings.Settings( json.allowInsecure, json.fingerprint, + json.echConfigList, ); } toJson() { return { allowInsecure: this.allowInsecure, fingerprint: this.fingerprint, + echConfigList: this.echConfigList }; } }; @@ -1375,6 +1387,9 @@ class Inbound extends XrayCommonClass { if (!ObjectUtil.isEmpty(this.stream.tls.sni)) { params.set("sni", this.stream.tls.sni); } + if (this.stream.tls.settings.echConfigList?.length > 0) { + params.set("ech", this.stream.tls.settings.echConfigList); + } if (type == "tcp" && !ObjectUtil.isEmpty(flow)) { params.set("flow", flow); } @@ -1474,6 +1489,9 @@ class Inbound extends XrayCommonClass { if (this.stream.tls.settings.allowInsecure) { params.set("allowInsecure", "1"); } + if (this.stream.tls.settings.echConfigList?.length > 0) { + params.set("ech", this.stream.tls.settings.echConfigList); + } if (!ObjectUtil.isEmpty(this.stream.tls.sni)) { params.set("sni", this.stream.tls.sni); } @@ -1552,6 +1570,9 @@ class Inbound extends XrayCommonClass { if (this.stream.tls.settings.allowInsecure) { params.set("allowInsecure", "1"); } + if (this.stream.tls.settings.echConfigList?.length > 0) { + params.set("ech", this.stream.tls.settings.echConfigList); + } if (!ObjectUtil.isEmpty(this.stream.tls.sni)) { params.set("sni", this.stream.tls.sni); } |
