mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
fix utls default
This commit is contained in:
parent
38f5e1cf29
commit
c01a1effbc
@ -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));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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));
|
||||||
|
|||||||
@ -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));
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user