Skip to content

Commit

Permalink
add uTLS option
Browse files Browse the repository at this point in the history
  • Loading branch information
xskill committed Oct 13, 2022
1 parent 3345620 commit 853fd32
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions public/root/etc/init.d/v2ray
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down Expand Up @@ -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' \
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions src/view/v2ray/inbound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,16 @@ return L.view.extend<string[]>({
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,
Expand Down
10 changes: 10 additions & 0 deletions src/view/v2ray/outbound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,16 @@ return L.view.extend<string[]>({
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,
Expand Down

0 comments on commit 853fd32

Please sign in to comment.