From 853fd3241aa3140782b320714334a78168dd4ced Mon Sep 17 00:00:00 2001 From: xskill Date: Thu, 13 Oct 2022 14:44:06 +0800 Subject: [PATCH] add uTLS option --- public/root/etc/init.d/v2ray | 9 +++++++++ src/view/v2ray/inbound.ts | 10 ++++++++++ src/view/v2ray/outbound.ts | 10 ++++++++++ 3 files changed, 29 insertions(+) diff --git a/public/root/etc/init.d/v2ray b/public/root/etc/init.d/v2ray index 7ebbef8..074dff8 100755 --- a/public/root/etc/init.d/v2ray +++ b/public/root/etc/init.d/v2ray @@ -286,6 +286,7 @@ inbound_section_validate() { 's_xtls_flow:or("none", "xtls-rprx-direct", "xtls-rprx-direct-udp443", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-splice", "xtls-rprx-splice-udp443")' \ 'ss_tls_server_name:host' \ 'ss_tls_alpn:list(string)' \ + 'u_tls:or("", "chrome", "firefox", "safari", "randomized")' \ 'ss_tls_allow_insecure:bool:0' \ 'ss_tls_allow_insecure_ciphers:bool:0' \ 'ss_tls_disable_system_root:bool:0' \ @@ -377,6 +378,7 @@ outbound_section_validate() { 's_xtls_flow:or("none", "xtls-rprx-direct", "xtls-rprx-direct-udp443", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-splice", "xtls-rprx-splice-udp443")' \ 'ss_tls_server_name:host' \ 'ss_tls_alpn:list(string)' \ + 'u_tls:or("", "chrome", "firefox", "safari", "randomized")' \ 'ss_tls_allow_insecure:bool:0' \ 'ss_tls_allow_insecure_ciphers:bool:0' \ 'ss_tls_disable_system_root:bool:0' \ @@ -1348,6 +1350,10 @@ add_inbound_setting() { json_close_array # destOverride fi + if [ "$u_tls" != "" ]; then + json_add_string "fingerprint" "$u_tls" + fi + json_add_boolean "allowInsecure" "$ss_tls_allow_insecure" json_add_boolean "allowInsecureCiphers" "$ss_tls_allow_insecure_ciphers" json_add_boolean "disableSystemRoot" "$ss_tls_disable_system_root" @@ -1846,6 +1852,9 @@ add_outbound_setting() { done json_close_array # destOverride fi + if [ "$u_tls" != "" ]; then + json_add_string "fingerprint" "$u_tls" + fi json_add_boolean "allowInsecure" "$ss_tls_allow_insecure" json_add_boolean "allowInsecureCiphers" "$ss_tls_allow_insecure_ciphers" json_add_boolean "disableSystemRoot" "$ss_tls_disable_system_root" diff --git a/src/view/v2ray/inbound.ts b/src/view/v2ray/inbound.ts index d121a33..93d858c 100644 --- a/src/view/v2ray/inbound.ts +++ b/src/view/v2ray/inbound.ts @@ -584,6 +584,16 @@ return L.view.extend({ o.depends("ss_security", "tls"); o.placeholder = "http/1.1"; + //uTLS + o = s.taboption("stream", form.ListValue, "u_tls", "uTLS"); + o.modalonly = true; + o.value("", _("None")); + o.value("chrome"); + o.value("firefox"); + o.value("safari"); + o.value("randomized"); + o.depends("ss_security", "tls"); + o = s.taboption( "stream", form.Flag, diff --git a/src/view/v2ray/outbound.ts b/src/view/v2ray/outbound.ts index f5ccb8d..0448905 100644 --- a/src/view/v2ray/outbound.ts +++ b/src/view/v2ray/outbound.ts @@ -740,6 +740,16 @@ return L.view.extend({ o.depends("ss_security", "tls"); o.placeholder = "http/1.1"; + //uTLS + o = s.taboption("stream", form.ListValue, "u_tls", "uTLS"); + o.modalonly = true; + o.value("", _("None")); + o.value("chrome"); + o.value("firefox"); + o.value("safari"); + o.value("randomized"); + o.depends("ss_security", "tls"); + o = s.taboption( "stream", form.Flag,