Skip to content

Commit 4315d1f

Browse files
committed
chore: AnyTLS
1 parent 1d96492 commit 4315d1f

File tree

3 files changed

+505
-359
lines changed

3 files changed

+505
-359
lines changed

luci-app-openclash/luasrc/model/cbi/openclash/servers-config.lua

+29-4
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,13 @@ o:value("hysteria2", translate("Hysteria2 ")..translate("(Only Meta Core)"))
143143
o:value("wireguard", translate("WireGuard")..translate("(Only Meta Core)"))
144144
o:value("tuic", translate("Tuic")..translate("(Only Meta Core)"))
145145
o:value("snell", translate("Snell"))
146-
o:value("mieru", translate("Mieru"))
146+
o:value("mieru", translate("Mieru")..translate("(Only Meta Core)"))
147+
o:value("anytls", translate("AnyTLS")..translate("(Only Meta Core)"))
147148
o:value("socks5", translate("Socks5"))
148149
o:value("http", translate("HTTP(S)"))
149-
o:value("direct", translate("DIRECT"))
150-
o:value("dns", translate("DNS"))
151-
o:value("ssh", translate("SSH"))
150+
o:value("direct", translate("DIRECT")..translate("(Only Meta Core)"))
151+
o:value("dns", translate("DNS")..translate("(Only Meta Core)"))
152+
o:value("ssh", translate("SSH")..translate("(Only Meta Core)"))
152153

153154
o.description = translate("Using incorrect encryption mothod may causes service fail to start")
154155

@@ -169,6 +170,7 @@ o:depends("type", "hysteria2")
169170
o:depends("type", "wireguard")
170171
o:depends("type", "tuic")
171172
o:depends("type", "mieru")
173+
o:depends("type", "anytls")
172174
o:depends("type", "snell")
173175
o:depends("type", "socks5")
174176
o:depends("type", "http")
@@ -188,6 +190,7 @@ o:depends("type", "hysteria2")
188190
o:depends("type", "wireguard")
189191
o:depends("type", "tuic")
190192
o:depends("type", "mieru")
193+
o:depends("type", "anytls")
191194
o:depends("type", "snell")
192195
o:depends("type", "socks5")
193196
o:depends("type", "http")
@@ -215,6 +218,7 @@ o:depends("type", "ssr")
215218
o:depends("type", "trojan")
216219
o:depends("type", "hysteria2")
217220
o:depends("type", "mieru")
221+
o:depends("type", "anytls")
218222

219223
-- [[ Mieru ]]--
220224
o = s:option(Value, "port_range", translate("Port Range"))
@@ -447,6 +451,7 @@ o:depends("type", "trojan")
447451
o:depends({type = "snell", snell_version = "3"})
448452
o:depends("type", "wireguard")
449453
o:depends("type", "direct")
454+
o:depends("type", "anytls")
450455

451456
o = s:option(ListValue, "udp_over_tcp", translate("udp-over-tcp"))
452457
o.rmempty = true
@@ -634,6 +639,7 @@ o:depends("type", "vless")
634639
o:depends("type", "hysteria")
635640
o:depends("type", "hysteria2")
636641
o:depends("type", "tuic")
642+
o:depends("type", "anytls")
637643

638644
-- [[ TLS ]]--
639645
o = s:option(ListValue, "tls", translate("TLS"))
@@ -680,6 +686,7 @@ o:depends("type", "trojan")
680686
o:depends("type", "http")
681687
o:depends("type", "hysteria")
682688
o:depends("type", "hysteria2")
689+
o:depends("type", "anytls")
683690

684691
-- [[ headers ]]--
685692
o = s:option(DynamicList, "http_headers", translate("headers"))
@@ -723,6 +730,7 @@ o.rmempty = true
723730
o:value("h2")
724731
o:value("http/1.1")
725732
o:depends("type", "trojan")
733+
o:depends("type", "anytls")
726734

727735
-- [[ alpn ]]--
728736
o = s:option(DynamicList, "hysteria_alpn", translate("alpn"))
@@ -872,6 +880,22 @@ o:value("true")
872880
o:value("false")
873881
o:depends("type", "vmess")
874882

883+
-- [[ AnyTLS ]]--
884+
o = s:option(Value, "idle_session_check_interval", translate("idle-session-check-interval"))
885+
o.rmempty = true
886+
o.default = "30"
887+
o:depends("type", "anytls")
888+
889+
o = s:option(Value, "idle_session_timeout", translate("idle-session-timeout"))
890+
o.rmempty = true
891+
o.default = "30"
892+
o:depends("type", "anytls")
893+
894+
o = s:option(Value, "min_idle_session", translate("min-idle-session"))
895+
o.rmempty = true
896+
o.default = "0"
897+
o:depends("type", "anytls")
898+
875899
-- [[ Fast Open ]]--
876900
o = s:option(ListValue, "fast_open", translate("Fast Open"))
877901
o.rmempty = true
@@ -929,6 +953,7 @@ o:depends({type = "vmess", obfs_vmess = "websocket"})
929953
o:depends({type = "vmess", obfs_vmess = "http"})
930954
o:depends({type = "vmess", obfs_vmess = "h2"})
931955
o:depends({type = "vmess", obfs_vmess = "grpc"})
956+
o:depends("type", "anytls")
932957

933958
-- [[ ip version ]]--
934959
o = s:option(ListValue, "ip_version", translate("IP Version")..translate("(Only Meta Core)"))

luci-app-openclash/root/usr/share/openclash/yml_proxys_get.sh

+63-1
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "
730730
};
731731
end;
732732
733-
#Mieru
733+
#Mieru
734734
if x['type'] == 'mieru' then
735735
threads << Thread.new{
736736
#port-range
@@ -761,6 +761,68 @@ ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "
761761
};
762762
end;
763763
764+
#AnyTLS
765+
if x['type'] == 'anytls' then
766+
threads << Thread.new{
767+
if x.key?('password') then
768+
uci_commands << uci_set + 'password=\"' + x['password'].to_s + '\"'
769+
end
770+
};
771+
772+
threads << Thread.new{
773+
#idle-session-check-interval
774+
if x.key?('idle-session-check-interval') then
775+
uci_commands << uci_set + 'idle_session_check_interval=\"' + x['idle-session-check-interval'].to_s + '\"'
776+
end
777+
};
778+
779+
threads << Thread.new{
780+
#idle-session-timeout
781+
if x.key?('idle-session-timeout') then
782+
uci_commands << uci_set + 'idle_session_timeout=\"' + x['idle-session-timeout'].to_s + '\"'
783+
end
784+
};
785+
786+
threads << Thread.new{
787+
#min-idle-session
788+
if x.key?('min-idle-session') then
789+
uci_commands << uci_set + 'min_idle_session=\"' + x['min-idle-session'].to_s + '\"'
790+
end
791+
};
792+
793+
threads << Thread.new{
794+
#alpn
795+
if x.key?('alpn') then
796+
alpn = uci_del + 'alpn >/dev/null 2>&1'
797+
system(alpn)
798+
x['alpn'].each{
799+
|x|
800+
uci_commands << uci_add + 'alpn=\"' + x.to_s + '\"'
801+
}
802+
end
803+
};
804+
805+
threads << Thread.new{
806+
#sni
807+
if x.key?('sni') then
808+
uci_commands << uci_set + 'sni=\"' + x['sni'].to_s + '\"'
809+
end
810+
};
811+
812+
#skip-cert-verify
813+
if x.key?('skip-cert-verify') then
814+
uci_commands << uci_set + 'skip_cert_verify=\"' + x['skip-cert-verify'].to_s + '\"'
815+
end
816+
};
817+
818+
threads << Thread.new{
819+
#client_fingerprint
820+
if x.key?('client-fingerprint') then
821+
uci_commands << uci_set + 'client_fingerprint=\"' + x['client-fingerprint'].to_s + '\"'
822+
end
823+
};
824+
end;
825+
764826
#Tuic
765827
if x['type'] == 'tuic' then
766828
threads << Thread.new{

0 commit comments

Comments
 (0)