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:
Tindy X committed 2020-01-21 00:37:45 +08:00
1 parent 0c76741a25
commit 7d03374016
4 files changed
+23 -5

No files matched your search

+10 -2
View File
@@ -20,7 +20,7 @@ static int writer(char *data, size_t size, size_t nmemb, std::string *writerData
return size * nmemb;
}
std::string curlGet(std::string url, std::string proxy)
std::string curlGet(std::string url, std::string proxy, std::string &response_headers)
{
CURL *curl_handle;
std::string data;
@@ -38,6 +38,8 @@ std::string curlGet(std::string url, std::string proxy)
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, user_agent_str.data());
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, writer);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, &data);
curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, writer);
curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, &response_headers);
if(proxy != "")
curl_easy_setopt(curl_handle, CURLOPT_PROXY, proxy.data());
@@ -54,9 +56,15 @@ std::string buildSocks5ProxyString(std::string addr, int port, std::string usern
return proxystr;
}
std::string webGet(std::string url, std::string proxy, std::string &response_headers)
{
return curlGet(url, proxy, response_headers);
}
std::string webGet(std::string url, std::string proxy)
{
return curlGet(url, proxy);
std::string dummy;
return curlGet(url, proxy, dummy);
}
int curlPost(std::string url, std::string data, std::string proxy, std::string auth_token, std::string *retData)