mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 18:24:58 +00:00
add vless reality support.
This commit is contained in:
1 parent
c9e074daf7
commit
0b15d63ef4
1 file changed
+20
@@ -486,6 +486,12 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
|
|||||||
singleproxy["flow"] = x.Flow;
|
singleproxy["flow"] = x.Flow;
|
||||||
if (!scv.is_undef())
|
if (!scv.is_undef())
|
||||||
singleproxy["skip-cert-verify"] = scv.get();
|
singleproxy["skip-cert-verify"] = scv.get();
|
||||||
|
if (!x.PublicKey.empty()) {
|
||||||
|
singleproxy["reality-opts"]["public-key"] = x.PublicKey;
|
||||||
|
}
|
||||||
|
if (!x.ShortId.empty()) {
|
||||||
|
singleproxy["reality-opts"]["short-id"] = x.ShortId;
|
||||||
|
}
|
||||||
switch (hash_(x.TransferProtocol)) {
|
switch (hash_(x.TransferProtocol)) {
|
||||||
case "tcp"_hash:
|
case "tcp"_hash:
|
||||||
break;
|
break;
|
||||||
@@ -681,6 +687,7 @@ void replaceAll(std::string& input, const std::string& search, const std::string
|
|||||||
pos += replace.length();
|
pos += replace.length();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// peer = (public-key = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=, allowed-ips = "0.0.0.0/0, ::/0", endpoint = engage.cloudflareclient.com:2408, client-id = 139/184/125),(public-key = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=, endpoint = engage.cloudflareclient.com:2408)
|
// peer = (public-key = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=, allowed-ips = "0.0.0.0/0, ::/0", endpoint = engage.cloudflareclient.com:2408, client-id = 139/184/125),(public-key = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=, endpoint = engage.cloudflareclient.com:2408)
|
||||||
std::string generatePeer(Proxy &node, bool client_id_as_reserved = false) {
|
std::string generatePeer(Proxy &node, bool client_id_as_reserved = false) {
|
||||||
std::string result;
|
std::string result;
|
||||||
@@ -2330,6 +2337,19 @@ proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json, std::vector
|
|||||||
if (!x.Alpn.empty())
|
if (!x.Alpn.empty())
|
||||||
tls.AddMember("alpn", rapidjson::StringRef(("[" + x.Alpn + "]").c_str()), allocator);
|
tls.AddMember("alpn", rapidjson::StringRef(("[" + x.Alpn + "]").c_str()), allocator);
|
||||||
tls.AddMember("insecure", buildBooleanValue(scv), allocator);
|
tls.AddMember("insecure", buildBooleanValue(scv), allocator);
|
||||||
|
if (x.Type == ProxyType::VLESS) {
|
||||||
|
rapidjson::Value reality(rapidjson::kObjectType);
|
||||||
|
if (!x.PublicKey.empty() || !x.ShortId.empty()) {
|
||||||
|
reality.AddMember("enabled", rapidjson::StringRef("false"), allocator);
|
||||||
|
if (!x.PublicKey.empty()) {
|
||||||
|
reality.AddMember("public_key", rapidjson::StringRef("false"), allocator);
|
||||||
|
}
|
||||||
|
if (!x.ShortId.empty()) {
|
||||||
|
reality.AddMember("short_id", rapidjson::StringRef(("[" + x.ShortId + "]").c_str()), allocator);
|
||||||
|
}
|
||||||
|
tls.AddMember("reality", reality, allocator);
|
||||||
|
}
|
||||||
|
}
|
||||||
proxy.AddMember("tls", tls, allocator);
|
proxy.AddMember("tls", tls, allocator);
|
||||||
}
|
}
|
||||||
if (!udp.is_undef() && !udp) {
|
if (!udp.is_undef() && !udp) {
|
||||||
|
|||||||
Reference in new issue
Block a user