fix utls default

This commit is contained in:
Nova 2025-12-08 14:59:17 +03:30
parent 38f5e1cf29
commit c01a1effbc
4 changed files with 5 additions and 0 deletions

View File

@ -9,11 +9,13 @@ namespace Configs
class uTLS : public baseConfig class uTLS : public baseConfig
{ {
public: public:
bool supported = true;
bool enabled = false; bool enabled = false;
QString fingerPrint; QString fingerPrint;
uTLS() uTLS()
{ {
_add(new configItem("supported", &supported, boolean));
_add(new configItem("enabled", &enabled, itemType::boolean)); _add(new configItem("enabled", &enabled, itemType::boolean));
_add(new configItem("fingerprint", &fingerPrint, string)); _add(new configItem("fingerprint", &fingerPrint, string));
} }

View File

@ -28,6 +28,7 @@ namespace Configs
hysteria() : outbound() hysteria() : outbound()
{ {
tls->utls->supported = false;
_add(new configItem("protocol_version", &protocol_version, string)); _add(new configItem("protocol_version", &protocol_version, string));
_add(new configItem("server_ports", &server_ports, stringList)); _add(new configItem("server_ports", &server_ports, stringList));
_add(new configItem("hop_interval", &hop_interval, string)); _add(new configItem("hop_interval", &hop_interval, string));

View File

@ -22,6 +22,7 @@ namespace Configs
tuic() : outbound() tuic() : outbound()
{ {
tls->utls->supported = false;
_add(new configItem("uuid", &uuid, string)); _add(new configItem("uuid", &uuid, string));
_add(new configItem("password", &password, string)); _add(new configItem("password", &password, string));
_add(new configItem("congestion_control", &congestion_control, string)); _add(new configItem("congestion_control", &congestion_control, string));

View File

@ -41,6 +41,7 @@ namespace Configs {
} }
BuildResult uTLS::Build() BuildResult uTLS::Build()
{ {
if (!supported) return {};
auto obj = ExportToJson(); auto obj = ExportToJson();
if ((obj.isEmpty() || obj["enabled"].toBool() == false || fingerPrint.isEmpty()) && !dataStore->utlsFingerprint.isEmpty()) { if ((obj.isEmpty() || obj["enabled"].toBool() == false || fingerPrint.isEmpty()) && !dataStore->utlsFingerprint.isEmpty()) {
obj["enabled"] = true; obj["enabled"] = true;