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