mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 02:02:24 +00:00
Bug fixes
Fix incorrect format for exporting Quantumult VMess subscriptions. Fix parser not recognize over-tls obfs in Quantumult X VMess subscriptions. Fix potential compatibility issue for non-standard VMess subscriptions. Add basic support for acquiring headers during subscription download.
This commit is contained in:
4 files changed
+23
-5
No files matched your search
+9
-2
@@ -69,6 +69,9 @@ std::string vmessConstruct(std::string add, std::string port, std::string type,
|
||||
host = add;
|
||||
if(!id.size())
|
||||
id = "00000000-0000-0000-0000-000000000000"; //fill this field for node with empty id
|
||||
host = trim(host);
|
||||
path = trim(path);
|
||||
|
||||
rapidjson::StringBuffer sb;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(sb);
|
||||
writer.StartObject();
|
||||
@@ -1273,12 +1276,12 @@ std::string netchToQuan(std::vector<nodeInfo> &nodes, extra_settings &ext)
|
||||
if(method == "auto")
|
||||
method = "chacha20-ietf-poly1305";
|
||||
proxyStr = remark + " = vmess, " + hostname + ", " + port + ", " + method + ", \"" + id + "\", group=" + x.group;
|
||||
if(transproto == "ws")
|
||||
proxyStr += ", obfs=ws, obfs-path=" + path + ", obfs-header=\"Host: " + host + "\"";
|
||||
if(tlssecure)
|
||||
proxyStr += ", over-tls=true, tls-host=" + host;
|
||||
if(ext.skip_cert_verify)
|
||||
proxyStr += ", certificate=0";
|
||||
if(transproto == "ws")
|
||||
proxyStr += ", obfs=ws, obfs-path=\"" + path + "\", obfs-header=\"Host: " + host + "\"";
|
||||
proxyStr = "vmess://" + urlsafe_base64_encode(proxyStr);
|
||||
break;
|
||||
case SPEEDTEST_MESSAGE_FOUNDSSR:
|
||||
@@ -1319,6 +1322,7 @@ std::string netchToQuanX(std::vector<nodeInfo> &nodes, extra_settings &ext)
|
||||
std::string id, transproto, host, path;
|
||||
std::string protocol, protoparam, obfs, obfsparam;
|
||||
std::string proxyStr, allLinks;
|
||||
bool tlssecure;
|
||||
|
||||
std::for_each(nodes.begin(), nodes.end(), [ext](nodeInfo &x)
|
||||
{
|
||||
@@ -1358,11 +1362,14 @@ std::string netchToQuanX(std::vector<nodeInfo> &nodes, extra_settings &ext)
|
||||
transproto = GetMember(json, "TransferProtocol");
|
||||
host = GetMember(json, "Host");
|
||||
path = GetMember(json, "Path");
|
||||
tlssecure = GetMember(json, "TLSSecure") == "true";
|
||||
if(method == "auto")
|
||||
method = "chacha20-ietf-poly1305";
|
||||
proxyStr = "vmess = " + hostname + ":" + port + ", method=" + method + ", password=" + id;
|
||||
if(transproto == "ws")
|
||||
proxyStr += ", obfs=ws, obfs-host=" + host + ", obfs-uri=" + path;
|
||||
else if(tlssecure)
|
||||
proxyStr += ", obfs=over-tls";
|
||||
if(ext.skip_cert_verify)
|
||||
proxyStr += ", certificate=0";
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user