update: some updates

This commit is contained in:
Qv2ray-dev 2020-06-18 00:29:27 +08:00
parent 3e547a70d4
commit 595103b54e
2 changed files with 8 additions and 5 deletions

View File

@ -1 +1 @@
5611 5612

View File

@ -62,6 +62,7 @@ namespace Qv2ray::core::connection
auto vmessPart = Base64Encode(JsonToString(vmessUriRoot, QJsonDocument::JsonFormat::Compact)); auto vmessPart = Base64Encode(JsonToString(vmessUriRoot, QJsonDocument::JsonFormat::Compact));
return "vmess://" + vmessPart; return "vmess://" + vmessPart;
} }
// This generates global config containing only one outbound.... // This generates global config containing only one outbound....
CONFIGROOT Deserialize(const QString &vmessStr, QString *alias, QString *errMessage) CONFIGROOT Deserialize(const QString &vmessStr, QString *alias, QString *errMessage)
{ {
@ -195,7 +196,8 @@ namespace Qv2ray::core::connection
path = vmessConf.contains("path") ? vmessConf["path"].toVariant().toString() : (net == "quic" ? "" : "/"); path = vmessConf.contains("path") ? vmessConf["path"].toVariant().toString() : (net == "quic" ? "" : "/");
host = vmessConf.contains("host") ? vmessConf["host"].toVariant().toString() : (net == "quic" ? "none" : ""); host = vmessConf.contains("host") ? vmessConf["host"].toVariant().toString() : (net == "quic" ? "none" : "");
} }
// Repect connection type rather than obfs type //
// Repect connection type rather than obfs type
if (QStringList{ "srtp", "utp", "wechat-video" }.contains(type)) // if (QStringList{ "srtp", "utp", "wechat-video" }.contains(type)) //
{ // { //
if (net != "quic" && net != "kcp") // if (net != "quic" && net != "kcp") //
@ -204,6 +206,7 @@ namespace Qv2ray::core::connection
type = "none"; // type = "none"; //
} // } //
} }
port = vmessConf["port"].toVariant().toInt(); port = vmessConf["port"].toVariant().toInt();
aid = vmessConf["aid"].toVariant().toInt(); aid = vmessConf["aid"].toVariant().toInt();
// //
@ -235,11 +238,11 @@ namespace Qv2ray::core::connection
else if (net == "http" || net == "h2") else if (net == "http" || net == "h2")
{ {
// Fill hosts for HTTP // Fill hosts for HTTP
for (auto _host : host.split(',')) for (const auto &_host : host.split(','))
{ {
if (!_host.isEmpty()) if (!_host.isEmpty())
{ {
streaming.httpSettings.host.push_back(_host.trimmed()); streaming.httpSettings.host << _host.trimmed();
} }
} }
@ -291,5 +294,5 @@ namespace Qv2ray::core::connection
return root; return root;
#undef default #undef default
} }
} // namespace Serialization::vmess } // namespace serialization::vmess
} // namespace Qv2ray::core::connection } // namespace Qv2ray::core::connection