mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
auto-fill fingerprint for reality
This commit is contained in:
@@ -53,18 +53,19 @@ namespace NekoGui_fmt {
|
|||||||
tls["alpn"] = QList2QJsonArray(alpn.split(","));
|
tls["alpn"] = QList2QJsonArray(alpn.split(","));
|
||||||
}
|
}
|
||||||
auto fp = utlsFingerprint.isEmpty() ? NekoGui::dataStore->utlsFingerprint : utlsFingerprint;
|
auto fp = utlsFingerprint.isEmpty() ? NekoGui::dataStore->utlsFingerprint : utlsFingerprint;
|
||||||
if (!fp.isEmpty()) {
|
|
||||||
tls["utls"] = QJsonObject{
|
|
||||||
{"enabled", true},
|
|
||||||
{"fingerprint", fp},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (!reality_pbk.trimmed().isEmpty()) {
|
if (!reality_pbk.trimmed().isEmpty()) {
|
||||||
tls["reality"] = QJsonObject{
|
tls["reality"] = QJsonObject{
|
||||||
{"enabled", true},
|
{"enabled", true},
|
||||||
{"public_key", reality_pbk},
|
{"public_key", reality_pbk},
|
||||||
{"short_id", reality_sid.split(",")[0]},
|
{"short_id", reality_sid.split(",")[0]},
|
||||||
};
|
};
|
||||||
|
if (fp.isEmpty()) fp = "chrome";
|
||||||
|
}
|
||||||
|
if (!fp.isEmpty()) {
|
||||||
|
tls["utls"] = QJsonObject{
|
||||||
|
{"enabled", true},
|
||||||
|
{"fingerprint", fp},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
outbound->insert("tls", tls);
|
outbound->insert("tls", tls);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace NekoGui_fmt {
|
|||||||
if (security == "tls") {
|
if (security == "tls") {
|
||||||
auto fp = utlsFingerprint.isEmpty() ? NekoGui::dataStore->utlsFingerprint : utlsFingerprint;
|
auto fp = utlsFingerprint.isEmpty() ? NekoGui::dataStore->utlsFingerprint : utlsFingerprint;
|
||||||
QJsonObject tls;
|
QJsonObject tls;
|
||||||
if (!fp.trimmed().isEmpty()) tls["fingerprint"] = fp;
|
if (!fp.isEmpty()) tls["fingerprint"] = fp;
|
||||||
if (!sni.trimmed().isEmpty()) tls["serverName"] = sni;
|
if (!sni.trimmed().isEmpty()) tls["serverName"] = sni;
|
||||||
if (reality_pbk.trimmed().isEmpty()) {
|
if (reality_pbk.trimmed().isEmpty()) {
|
||||||
if (allow_insecure || NekoGui::dataStore->skip_cert) tls["allowInsecure"] = true;
|
if (allow_insecure || NekoGui::dataStore->skip_cert) tls["allowInsecure"] = true;
|
||||||
@@ -65,6 +65,7 @@ namespace NekoGui_fmt {
|
|||||||
tls["publicKey"] = reality_pbk;
|
tls["publicKey"] = reality_pbk;
|
||||||
tls["shortId"] = reality_sid;
|
tls["shortId"] = reality_sid;
|
||||||
tls["spiderX"] = reality_spx;
|
tls["spiderX"] = reality_spx;
|
||||||
|
if (fp.isEmpty()) tls["fingerprint"] = "chrome";
|
||||||
streamSettings["realitySettings"] = tls;
|
streamSettings["realitySettings"] = tls;
|
||||||
streamSettings["security"] = "reality";
|
streamSettings["security"] = "reality";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user