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));
return "vmess://" + vmessPart;
}
// This generates global config containing only one outbound....
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" ? "" : "/");
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 (net != "quic" && net != "kcp") //
@ -204,6 +206,7 @@ namespace Qv2ray::core::connection
type = "none"; //
} //
}
port = vmessConf["port"].toVariant().toInt();
aid = vmessConf["aid"].toVariant().toInt();
//
@ -235,11 +238,11 @@ namespace Qv2ray::core::connection
else if (net == "http" || net == "h2")
{
// Fill hosts for HTTP
for (auto _host : host.split(','))
for (const auto &_host : host.split(','))
{
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;
#undef default
}
} // namespace Serialization::vmess
} // namespace serialization::vmess
} // namespace Qv2ray::core::connection