mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-05 03:02:06 +00:00
Fix alpn issues.(#30)
This commit is contained in:
1 parent
c4aa8c5b5e
commit
7dec83d529
4 files changed
+115
-34
No files matched your search
@@ -277,6 +277,12 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
|
||||
singleproxy["alterId"] = x.AlterId;
|
||||
singleproxy["cipher"] = x.EncryptMethod;
|
||||
singleproxy["tls"] = x.TLSSecure;
|
||||
if (!x.AlpnList.empty()) {
|
||||
for (auto &item: x.AlpnList) {
|
||||
singleproxy["alpn"].push_back(item);
|
||||
}
|
||||
} else if (!x.Alpn.empty())
|
||||
singleproxy["alpn"].push_back(x.Alpn);
|
||||
if (!scv.is_undef())
|
||||
singleproxy["skip-cert-verify"] = scv.get();
|
||||
if (!x.ServerName.empty())
|
||||
@@ -386,6 +392,12 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
|
||||
else if (!x.Host.empty()) {
|
||||
singleproxy["sni"] = x.Host;
|
||||
}
|
||||
if (!x.AlpnList.empty()) {
|
||||
for (auto &item: x.AlpnList) {
|
||||
singleproxy["alpn"].push_back(item);
|
||||
}
|
||||
} else if (!x.Alpn.empty())
|
||||
singleproxy["alpn"].push_back(x.Alpn);
|
||||
if (std::all_of(x.Password.begin(), x.Password.end(), ::isdigit) && !x.Password.empty()) {
|
||||
singleproxy["password"].SetTag("str");
|
||||
}
|
||||
@@ -520,6 +532,11 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
|
||||
singleproxy["type"] = "vless";
|
||||
singleproxy["uuid"] = x.UserId;
|
||||
singleproxy["tls"] = x.TLSSecure;
|
||||
if (!x.AlpnList.empty()) {
|
||||
for (auto &item: x.AlpnList) {
|
||||
singleproxy["alpn"].push_back(item);
|
||||
}
|
||||
}
|
||||
if (!tfo.is_undef())
|
||||
singleproxy["tfo"] = tfo.get();
|
||||
if (xudp && udp)
|
||||
@@ -708,6 +725,7 @@ void formatterShortId(std::string &input){
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string proxyToClash(std::vector<Proxy> &nodes, const std::string &base_conf,
|
||||
std::vector<RulesetContent> &ruleset_content_array, const ProxyGroupConfigs &extra_proxy_group,
|
||||
bool clashR, extra_settings &ext) {
|
||||
@@ -2255,6 +2273,14 @@ static rapidjson::Value stringArrayToJsonArray(const std::string &array, const s
|
||||
return result;
|
||||
}
|
||||
|
||||
static rapidjson::Value
|
||||
vectorToJsonArray(const std::vector<std::string> &array, rapidjson::MemoryPoolAllocator<> &allocator) {
|
||||
rapidjson::Value result(rapidjson::kArrayType);
|
||||
for (const auto &x: array)
|
||||
result.PushBack(rapidjson::Value(trim(x).c_str(), allocator), allocator);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool isNumeric(const std::string &str) {
|
||||
for (char c: str) {
|
||||
if (!std::isdigit(static_cast<unsigned char>(c))) {
|
||||
@@ -2572,7 +2598,10 @@ proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json, std::vector
|
||||
tls.AddMember("enabled", true, allocator);
|
||||
if (!x.ServerName.empty())
|
||||
tls.AddMember("server_name", rapidjson::StringRef(x.ServerName.c_str()), allocator);
|
||||
if (!x.Alpn.empty()) {
|
||||
if (!x.AlpnList.empty()) {
|
||||
auto alpns = vectorToJsonArray(x.AlpnList, allocator);
|
||||
tls.AddMember("alpn", alpns, allocator);
|
||||
} else if (!x.Alpn.empty()) {
|
||||
auto alpns = stringArrayToJsonArray(x.Alpn, ",", allocator);
|
||||
tls.AddMember("alpn", alpns, allocator);
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ struct Proxy {
|
||||
String UdpRelayMode = "native";
|
||||
uint16_t RequestTimeout = 15000;
|
||||
String token;
|
||||
std::vector<String> AlpnList;
|
||||
};
|
||||
|
||||
#define SS_DEFAULT_GROUP "SSProvider"
|
||||
|
||||
+74
-30
@@ -51,7 +51,8 @@ void commonConstruct(Proxy &node, ProxyType type, const std::string &group, cons
|
||||
void vmessConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add,
|
||||
const std::string &port, const std::string &type, const std::string &id, const std::string &aid,
|
||||
const std::string &net, const std::string &cipher, const std::string &path, const std::string &host,
|
||||
const std::string &edge, const std::string &tls, const std::string &sni, tribool udp, tribool tfo,
|
||||
const std::string &edge, const std::string &tls, const std::string &sni,
|
||||
const std::vector<std::string> &alpnList, tribool udp, tribool tfo,
|
||||
tribool scv, tribool tls13) {
|
||||
commonConstruct(node, ProxyType::VMess, group, remarks, add, port, udp, tfo, scv, tls13);
|
||||
node.UserId = id.empty() ? "00000000-0000-0000-0000-000000000000" : id;
|
||||
@@ -117,6 +118,7 @@ void httpConstruct(Proxy &node, const std::string &group, const std::string &rem
|
||||
void trojanConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
const std::string &port, const std::string &password, const std::string &network,
|
||||
const std::string &host, const std::string &path, const std::string &fp, const std::string &sni,
|
||||
const std::vector<std::string> &alpnList,
|
||||
bool tlssecure,
|
||||
tribool udp, tribool tfo,
|
||||
tribool scv, tribool tls13) {
|
||||
@@ -128,6 +130,7 @@ void trojanConstruct(Proxy &node, const std::string &group, const std::string &r
|
||||
node.Path = path;
|
||||
node.Fingerprint = fp;
|
||||
node.ServerName = sni;
|
||||
node.AlpnList = alpnList;
|
||||
}
|
||||
|
||||
void snellConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
@@ -186,6 +189,7 @@ void vlessConstruct(Proxy &node, const std::string &group, const std::string &re
|
||||
const std::string &net, const std::string &cipher, const std::string &flow, const std::string &mode,
|
||||
const std::string &path, const std::string &host, const std::string &edge, const std::string &tls,
|
||||
const std::string &pbk, const std::string &sid, const std::string &fp, const std::string &sni,
|
||||
const std::vector<std::string> &alpnList,
|
||||
tribool udp, tribool tfo,
|
||||
tribool scv, tribool tls13) {
|
||||
commonConstruct(node, ProxyType::VLESS, group, remarks, add, port, udp, tfo, scv, tls13);
|
||||
@@ -201,6 +205,7 @@ void vlessConstruct(Proxy &node, const std::string &group, const std::string &re
|
||||
node.ShortId = sid;
|
||||
node.Fingerprint = fp;
|
||||
node.ServerName = sni;
|
||||
node.AlpnList = alpnList;
|
||||
switch (hash_(net)) {
|
||||
case "grpc"_hash:
|
||||
node.Host = host;
|
||||
@@ -319,7 +324,7 @@ void explodeVmess(std::string vmess, Proxy &node) {
|
||||
|
||||
add = trim(add);
|
||||
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, ps, add, port, type, id, aid, net, "auto", path, host, "", tls, sni);
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, ps, add, port, type, id, aid, net, "auto", path, host, "", tls, sni,std::vector<std::string>{});
|
||||
}
|
||||
|
||||
void explodeVmessConf(std::string content, std::vector<Proxy> &nodes) {
|
||||
@@ -390,7 +395,7 @@ void explodeVmessConf(std::string content, std::vector<Proxy> &nodes) {
|
||||
}
|
||||
}
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, add + ":" + port, add, port, type, id, aid, net, cipher, path,
|
||||
host, edge, tls, "", udp, tfo, scv);
|
||||
host, edge, tls, "",std::vector<std::string>{}, udp, tfo, scv);
|
||||
nodes.emplace_back(std::move(node));
|
||||
}
|
||||
return;
|
||||
@@ -443,7 +448,7 @@ void explodeVmessConf(std::string content, std::vector<Proxy> &nodes) {
|
||||
json["vmess"][i]["security"] >> cipher;
|
||||
json["vmess"][i]["sni"] >> sni;
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, ps, add, port, type, id, aid, net, cipher, path, host, "",
|
||||
tls, sni, udp, tfo, scv);
|
||||
tls, sni,std::vector<std::string>{}, udp, tfo, scv);
|
||||
break;
|
||||
case 3: //ss config
|
||||
json["vmess"][i]["id"] >> id;
|
||||
@@ -881,8 +886,13 @@ void explodeTrojan(std::string trojan, Proxy &node) {
|
||||
remark = server + ":" + port;
|
||||
if (group.empty())
|
||||
group = TROJAN_DEFAULT_GROUP;
|
||||
|
||||
trojanConstruct(node, group, remark, server, port, psk, network, host, path, fp, sni, true, tribool(), tfo, scv);
|
||||
std::string alpn = getUrlArg(addition, "alpn");
|
||||
std::vector<std::string> alpnList;
|
||||
if (!alpn.empty()) {
|
||||
alpnList.push_back(alpn);
|
||||
}
|
||||
trojanConstruct(node, group, remark, server, port, psk, network, host, path, fp, sni, alpnList, true, tribool(),
|
||||
tfo, scv);
|
||||
}
|
||||
|
||||
void explodeVless(std::string vless, Proxy &node) {
|
||||
@@ -970,7 +980,7 @@ void explodeQuan(const std::string &quan, Proxy &node) {
|
||||
if (path.empty())
|
||||
path = "/";
|
||||
|
||||
vmessConstruct(node, group, ps, add, port, type, id, aid, net, cipher, path, host, edge, tls, "");
|
||||
vmessConstruct(node, group, ps, add, port, type, id, aid, net, cipher, path, host, edge, tls, "",std::vector<std::string>{});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1036,10 +1046,11 @@ void explodeNetch(std::string netch, Proxy &node) {
|
||||
edge = GetMember(json, "Edge");
|
||||
tls = GetMember(json, "TLSSecure");
|
||||
sni = GetMember(json, "ServerName");
|
||||
|
||||
if (group.empty())
|
||||
group = V2RAY_DEFAULT_GROUP;
|
||||
vmessConstruct(node, group, remark, address, port, faketype, id, aid, transprot, method, path, host, edge,
|
||||
tls, sni, udp, tfo, scv);
|
||||
tls, sni,std::vector<std::string>{}, udp, tfo, scv);
|
||||
break;
|
||||
case "Socks5"_hash:
|
||||
username = GetMember(json, "Username");
|
||||
@@ -1061,7 +1072,8 @@ void explodeNetch(std::string netch, Proxy &node) {
|
||||
sni = host;
|
||||
if (group.empty())
|
||||
group = TROJAN_DEFAULT_GROUP;
|
||||
trojanConstruct(node, group, remark, address, port, password, transprot, host, path, fp, sni, tls == "true",
|
||||
trojanConstruct(node, group, remark, address, port, password, transprot, host, path, fp, sni,
|
||||
std::vector<std::string>{}, tls == "true",
|
||||
udp,
|
||||
tfo, scv);
|
||||
break;
|
||||
@@ -1097,6 +1109,7 @@ void explodeClash(Node yamlnode, std::vector<Proxy> &nodes) {
|
||||
string_array dns_server;
|
||||
tribool udp, tfo, scv;
|
||||
bool reduceRtt, disableSni;//tuic
|
||||
std::vector<std::string> alpnList;
|
||||
Proxy node;
|
||||
singleproxy = yamlnode[section][i];
|
||||
singleproxy["type"] >>= proxytype;
|
||||
@@ -1149,8 +1162,9 @@ void explodeClash(Node yamlnode, std::vector<Proxy> &nodes) {
|
||||
break;
|
||||
}
|
||||
tls = safe_as<std::string>(singleproxy["tls"]) == "true" ? "tls" : "";
|
||||
|
||||
vmessConstruct(node, group, ps, server, port, "", id, aid, net, cipher, path, host, edge, tls, sni, udp,
|
||||
singleproxy["alpn"] >>= alpnList;
|
||||
vmessConstruct(node, group, ps, server, port, "", id, aid, net, cipher, path, host, edge, tls, sni,
|
||||
alpnList, udp,
|
||||
tfo, scv);
|
||||
break;
|
||||
case "ss"_hash:
|
||||
@@ -1269,8 +1283,10 @@ void explodeClash(Node yamlnode, std::vector<Proxy> &nodes) {
|
||||
path.clear();
|
||||
break;
|
||||
}
|
||||
singleproxy["alpn"] >>= alpnList;
|
||||
|
||||
trojanConstruct(node, group, ps, server, port, password, net, host, path, fp, sni, true, udp, tfo, scv);
|
||||
trojanConstruct(node, group, ps, server, port, password, net, host, path, fp, sni, alpnList, true, udp,
|
||||
tfo, scv);
|
||||
break;
|
||||
case "snell"_hash:
|
||||
group = SNELL_DEFAULT_GROUP;
|
||||
@@ -1343,9 +1359,9 @@ void explodeClash(Node yamlnode, std::vector<Proxy> &nodes) {
|
||||
}
|
||||
singleproxy["flow"] >>= flow;
|
||||
singleproxy["client-fingerprint"] >>= fp;
|
||||
|
||||
singleproxy["alpn"] >>= alpnList;
|
||||
vlessConstruct(node, XRAY_DEFAULT_GROUP, ps, server, port, type, id, aid, net, "auto", flow, mode, path,
|
||||
host, "", tls, pbk, sid, fp, sni);
|
||||
host, "", tls, pbk, sid, fp, sni, alpnList);
|
||||
break;
|
||||
case "hysteria"_hash:
|
||||
group = HYSTERIA_DEFAULT_GROUP;
|
||||
@@ -1362,6 +1378,7 @@ void explodeClash(Node yamlnode, std::vector<Proxy> &nodes) {
|
||||
singleproxy["protocol"] >> type;
|
||||
singleproxy["sni"] >> host;
|
||||
singleproxy["alpn"][0] >> alpn;
|
||||
singleproxy["alpn"] >> alpnList;
|
||||
singleproxy["protocol"] >> insecure;
|
||||
singleproxy["ports"] >> ports;
|
||||
sni = host;
|
||||
@@ -1452,8 +1469,12 @@ void explodeStdVMess(std::string vmess, Proxy &node) {
|
||||
|
||||
if (remarks.empty())
|
||||
remarks = add + ":" + port;
|
||||
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, remarks, add, port, type, id, aid, net, "auto", path, host, "", tls, "");
|
||||
std::string alpn = getUrlArg(addition, "alpn");
|
||||
std::vector<std::string> alpnList;
|
||||
if (!alpn.empty()) {
|
||||
alpnList.push_back(alpn);
|
||||
}
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, remarks, add, port, type, id, aid, net, "auto", path, host, "", tls, "",alpnList);
|
||||
}
|
||||
|
||||
|
||||
@@ -1484,7 +1505,10 @@ void explodeStdHysteria(std::string hysteria, Proxy &node) {
|
||||
|
||||
if (remarks.empty())
|
||||
remarks = add + ":" + port;
|
||||
|
||||
std::vector<std::string> alpnList;
|
||||
if (!alpn.empty()) {
|
||||
alpnList.push_back(alpn);
|
||||
}
|
||||
hysteriaConstruct(node, HYSTERIA_DEFAULT_GROUP, remarks, add, port, type, auth, auth_str, host, up, down, alpn,
|
||||
obfsParam,
|
||||
insecure, "", sni);
|
||||
@@ -1564,7 +1588,11 @@ void explodeStdVless(std::string vless, Proxy &node) {
|
||||
pbk = getUrlArg(addition, "pbk");
|
||||
sid = getUrlArg(addition, "sid");
|
||||
fp = getUrlArg(addition, "fp");
|
||||
|
||||
std::string alpn = getUrlArg(addition, "alpn");
|
||||
std::vector<std::string> alpnList;
|
||||
if (!alpn.empty()) {
|
||||
alpnList.push_back(alpn);
|
||||
}
|
||||
switch (hash_(net)) {
|
||||
case "tcp"_hash:
|
||||
case "ws"_hash:
|
||||
@@ -1591,7 +1619,7 @@ void explodeStdVless(std::string vless, Proxy &node) {
|
||||
remarks = add + ":" + port;
|
||||
sni = getUrlArg(addition, "sni");
|
||||
vlessConstruct(node, XRAY_DEFAULT_GROUP, remarks, add, port, type, id, aid, net, "auto", flow, mode, path, host, "",
|
||||
tls, pbk, sid, fp, sni);
|
||||
tls, pbk, sid, fp, sni, alpnList);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1630,8 +1658,12 @@ void explodeShadowrocket(std::string rocket, Proxy &node) {
|
||||
|
||||
if (remarks.empty())
|
||||
remarks = add + ":" + port;
|
||||
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, remarks, add, port, type, id, aid, net, cipher, path, host, "", tls, "");
|
||||
std::string alpn = getUrlArg(addition, "alpn");
|
||||
std::vector<std::string> alpnList;
|
||||
if (!alpn.empty()) {
|
||||
alpnList.push_back(alpn);
|
||||
}
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, remarks, add, port, type, id, aid, net, cipher, path, host, "", tls, "",alpnList);
|
||||
}
|
||||
|
||||
void explodeKitsunebi(std::string kit, Proxy &node) {
|
||||
@@ -1665,8 +1697,12 @@ void explodeKitsunebi(std::string kit, Proxy &node) {
|
||||
|
||||
if (remarks.empty())
|
||||
remarks = add + ":" + port;
|
||||
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, remarks, add, port, type, id, aid, net, cipher, path, host, "", tls, "");
|
||||
std::string alpn = getUrlArg(addition, "alpn");
|
||||
std::vector<std::string> alpnList;
|
||||
if (!alpn.empty()) {
|
||||
alpnList.push_back(alpn);
|
||||
}
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, remarks, add, port, type, id, aid, net, cipher, path, host, "", tls, "",alpnList);
|
||||
}
|
||||
|
||||
// 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)
|
||||
@@ -1952,7 +1988,7 @@ bool explodeSurge(std::string surge, std::vector<Proxy> &nodes) {
|
||||
}
|
||||
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, remarks, server, port, "", id, aead, net, method, path, host,
|
||||
edge, tls, "", udp, tfo, scv, tls13);
|
||||
edge, tls, "",std::vector<std::string>{}, udp, tfo, scv, tls13);
|
||||
break;
|
||||
case "http"_hash: //http proxy
|
||||
server = trim(configs[1]);
|
||||
@@ -2019,6 +2055,7 @@ bool explodeSurge(std::string surge, std::vector<Proxy> &nodes) {
|
||||
}
|
||||
|
||||
trojanConstruct(node, TROJAN_DEFAULT_GROUP, remarks, server, port, password, "", host, "", fp, sni,
|
||||
std::vector<std::string>{},
|
||||
true,
|
||||
udp,
|
||||
tfo, scv);
|
||||
@@ -2282,7 +2319,7 @@ bool explodeSurge(std::string surge, std::vector<Proxy> &nodes) {
|
||||
remarks = server + ":" + port;
|
||||
|
||||
vmessConstruct(node, V2RAY_DEFAULT_GROUP, remarks, server, port, "", id, aead, net, method,
|
||||
path, host, "", tls, "", udp, tfo, scv, tls13);
|
||||
path, host, "", tls, "",std::vector<std::string>{}, udp, tfo, scv, tls13);
|
||||
break;
|
||||
case "vless"_hash: //quantumult x style vless link
|
||||
server = trim(configs[0].substr(0, configs[0].rfind(":")));
|
||||
@@ -2349,7 +2386,7 @@ bool explodeSurge(std::string surge, std::vector<Proxy> &nodes) {
|
||||
remarks = server + ":" + port;
|
||||
vlessConstruct(node, XRAY_DEFAULT_GROUP, remarks, server, port, "", id, aead, net, method,
|
||||
"chrome", "", path, host, "",
|
||||
tls, "", "", fp, sni, udp, tfo, scv, tls13);
|
||||
tls, "", "", fp, sni, std::vector<std::string>{}, udp, tfo, scv, tls13);
|
||||
break;
|
||||
case "trojan"_hash: //quantumult x style trojan link
|
||||
server = trim(configs[0].substr(0, configs[0].rfind(':')));
|
||||
@@ -2400,7 +2437,7 @@ bool explodeSurge(std::string surge, std::vector<Proxy> &nodes) {
|
||||
remarks = server + ":" + port;
|
||||
|
||||
trojanConstruct(node, TROJAN_DEFAULT_GROUP, remarks, server, port, password, "", host, "", fp,
|
||||
sni,
|
||||
sni, std::vector<std::string>{},
|
||||
tls == "true", udp, tfo, scv, tls13);
|
||||
break;
|
||||
case "http"_hash: //quantumult x style http links
|
||||
@@ -2648,6 +2685,7 @@ void explodeSingbox(rapidjson::Value &outbounds, std::vector<Proxy> &nodes) {
|
||||
server = GetMember(singboxNode, "server");
|
||||
port = GetMember(singboxNode, "server_port");
|
||||
tfo = GetMember(singboxNode, "tcp_fast_open");
|
||||
std::vector<std::string> alpnList;
|
||||
if (singboxNode.HasMember("tls") && singboxNode["tls"].IsObject()) {
|
||||
rapidjson::Value tlsObj = singboxNode["tls"].GetObject();
|
||||
if (tlsObj.HasMember("enabled") && tlsObj["enabled"].IsBool() && tlsObj["enabled"].GetBool()) {
|
||||
@@ -2658,6 +2696,10 @@ void explodeSingbox(rapidjson::Value &outbounds, std::vector<Proxy> &nodes) {
|
||||
rapidjson::Value alpns = tlsObj["alpn"].GetArray();
|
||||
if (alpns.Size() > 0) {
|
||||
alpn = alpns[0].GetString();
|
||||
for (auto &item: tlsObj["alpn"].GetArray()) {
|
||||
if (item.IsString())
|
||||
alpnList.emplace_back(item.GetString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tlsObj.HasMember("insecure") && tlsObj["insecure"].IsBool()) {
|
||||
@@ -2696,7 +2738,7 @@ void explodeSingbox(rapidjson::Value &outbounds, std::vector<Proxy> &nodes) {
|
||||
cipher = GetMember(singboxNode, "security");
|
||||
explodeSingboxTransport(singboxNode, net, host, path, edge);
|
||||
vmessConstruct(node, group, ps, server, port, "", id, aid, net, cipher, path, host, edge, tls,
|
||||
sni, udp,
|
||||
sni,alpnList, udp,
|
||||
tfo, scv);
|
||||
break;
|
||||
case "shadowsocks"_hash:
|
||||
@@ -2711,7 +2753,8 @@ void explodeSingbox(rapidjson::Value &outbounds, std::vector<Proxy> &nodes) {
|
||||
group = TROJAN_DEFAULT_GROUP;
|
||||
password = GetMember(singboxNode, "password");
|
||||
explodeSingboxTransport(singboxNode, net, host, path, edge);
|
||||
trojanConstruct(node, group, ps, server, port, password, net, host, path, fp, sni, true, udp,
|
||||
trojanConstruct(node, group, ps, server, port, password, net, host, path, fp, sni, alpnList,
|
||||
true, udp,
|
||||
tfo,
|
||||
scv);
|
||||
break;
|
||||
@@ -2755,8 +2798,9 @@ void explodeSingbox(rapidjson::Value &outbounds, std::vector<Proxy> &nodes) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vlessConstruct(node, group, ps, server, port, type, id, aid, net, "auto", flow, mode, path,
|
||||
host, "", tls, pbk, sid, fp, sni);
|
||||
host, "", tls, pbk, sid, fp, sni, alpnList);
|
||||
break;
|
||||
case "http"_hash:
|
||||
password = GetMember(singboxNode, "password");
|
||||
|
||||
+10
-3
@@ -40,13 +40,15 @@ void vlessConstruct(Proxy &node, const std::string &group, const std::string &re
|
||||
const std::string &net, const std::string &cipher, const std::string &flow, const std::string &mode,
|
||||
const std::string &path, const std::string &host, const std::string &edge, const std::string &tls,
|
||||
const std::string &pkd, const std::string &sid, const std::string &fp, const std::string &sni,
|
||||
const std::vector<std::string> &alpnList,
|
||||
tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(),
|
||||
tribool tls13 = tribool());
|
||||
|
||||
void vmessConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add,
|
||||
const std::string &port, const std::string &type, const std::string &id, const std::string &aid,
|
||||
const std::string &net, const std::string &cipher, const std::string &path, const std::string &host,
|
||||
const std::string &edge, const std::string &tls, const std::string &sni, tribool udp = tribool(),
|
||||
const std::string &edge, const std::string &tls, const std::string &sni,
|
||||
const std::vector<std::string> &alpnList, tribool udp = tribool(),
|
||||
tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||
|
||||
void ssrConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
@@ -71,6 +73,7 @@ void httpConstruct(Proxy &node, const std::string &group, const std::string &rem
|
||||
void trojanConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
const std::string &port, const std::string &password, const std::string &network,
|
||||
const std::string &host, const std::string &path, const std::string &fp, const std::string &sni,
|
||||
const std::vector<std::string> &alpnList,
|
||||
bool tlssecure, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(),
|
||||
tribool tls13 = tribool());
|
||||
|
||||
@@ -78,12 +81,16 @@ void snellConstruct(Proxy &node, const std::string &group, const std::string &re
|
||||
const std::string &port, const std::string &password, const std::string &obfs,
|
||||
const std::string &host, uint16_t version = 0, tribool udp = tribool(), tribool tfo = tribool(),
|
||||
tribool scv = tribool());
|
||||
|
||||
void tuicConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add,
|
||||
const std::string &port, const std::string &password, const std::string &congestion_control,
|
||||
const std::string &alpn,
|
||||
const std::string &sni,const std::string & uuid,const std::string &udpRelayMode,const std::string &token,
|
||||
const std::string &sni, const std::string &uuid, const std::string &udpRelayMode,
|
||||
const std::string &token,
|
||||
tribool udp = tribool(), tribool tfo = tribool(),
|
||||
tribool scv = tribool(),tribool reduceRtt = tribool(),tribool disableSni = tribool(),uint16_t request_timeout = 15000);
|
||||
tribool scv = tribool(), tribool reduceRtt = tribool(), tribool disableSni = tribool(),
|
||||
uint16_t request_timeout = 15000);
|
||||
|
||||
void explodeVmess(std::string vmess, Proxy &node);
|
||||
|
||||
void explodeSSR(std::string ssr, Proxy &node);
|
||||
|
||||
Reference in new issue
Block a user