[vmess] Fixed a vmess import bug. See #63

Former-commit-id: a9cd17446c
This commit is contained in:
Leroy.H.Y 2019-09-22 14:51:55 +08:00
parent df10722ede
commit db75d5ec8b

View File

@ -51,24 +51,28 @@ namespace Qv2ray
// Stream Settings // Stream Settings
StreamSettingsObject streaming; StreamSettingsObject streaming;
// Fill hosts for HTTP if (net == "tcp") {
foreach (auto _host, QString::fromStdString(host).split(',')) { streaming.tcpSettings.header.type = type;
streaming.httpSettings.host.push_back(_host.toStdString()); } else if (net == "http") {
// Fill hosts for HTTP
foreach (auto _host, QString::fromStdString(host).split(',')) {
streaming.httpSettings.host.push_back(_host.toStdString());
}
streaming.httpSettings.path = path;
} else if (net == "ws") {
streaming.wsSettings.headers.insert(make_pair("Host", host));
streaming.wsSettings.path = path;
} else if (net == "kcp") {
streaming.kcpSettings.header.type = type;
} else if (net == "domainsocket") {
streaming.dsSettings.path = path;
} else if (net == "quic") {
streaming.quicSettings.security = host;
streaming.quicSettings.header.type = type;
streaming.quicSettings.key = path;
} }
// hosts for ws, h2 and security for QUIC
streaming.wsSettings.headers.insert(make_pair("Host", host));
streaming.quicSettings.security = host;
//
// Fake type for tcp, kcp and QUIC
streaming.tcpSettings.header.type = type;
streaming.kcpSettings.header.type = type;
streaming.quicSettings.header.type = type;
//
// Path for ws, h2, Quic
streaming.wsSettings.path = path;
streaming.httpSettings.path = path;
streaming.quicSettings.key = path;
streaming.security = tls; streaming.security = tls;
// //
// Network type // Network type