mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-02 01:33:04 +00:00
Add case for when no net type is set for VMess nodes
Optimize codes.
This commit is contained in:
2 files changed
+4
-5
No files matched your search
@@ -2,7 +2,6 @@
|
|||||||
#define SPEEDTESTUTIL_H_INCLUDED
|
#define SPEEDTESTUTIL_H_INCLUDED
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "nodeinfo.h"
|
#include "nodeinfo.h"
|
||||||
|
|||||||
+4
-4
@@ -90,21 +90,21 @@ std::string vmessConstruct(const std::string &group, const std::string &remarks,
|
|||||||
writer.Key("Port");
|
writer.Key("Port");
|
||||||
writer.Int(to_int(port));
|
writer.Int(to_int(port));
|
||||||
writer.Key("UserID");
|
writer.Key("UserID");
|
||||||
writer.String(id.size() ? id.data() : "00000000-0000-0000-0000-000000000000");
|
writer.String(id.empty() ? "00000000-0000-0000-0000-000000000000" : id.data());
|
||||||
writer.Key("AlterID");
|
writer.Key("AlterID");
|
||||||
writer.Int(to_int(aid));
|
writer.Int(to_int(aid));
|
||||||
writer.Key("EncryptMethod");
|
writer.Key("EncryptMethod");
|
||||||
writer.String(cipher.data());
|
writer.String(cipher.data());
|
||||||
writer.Key("TransferProtocol");
|
writer.Key("TransferProtocol");
|
||||||
writer.String(net.data());
|
writer.String(net.empty() ? "tcp" : net.data());
|
||||||
writer.Key("Host");
|
writer.Key("Host");
|
||||||
writer.String(host.size() ? trim(host).data() : add.data());
|
writer.String(host.empty() ? add.data() : trim(host).data());
|
||||||
writer.Key("Edge");
|
writer.Key("Edge");
|
||||||
writer.String(edge.data());
|
writer.String(edge.data());
|
||||||
if(net == "ws" || net == "http")
|
if(net == "ws" || net == "http")
|
||||||
{
|
{
|
||||||
writer.Key("Path");
|
writer.Key("Path");
|
||||||
writer.String(path.size() ? trim(path).data() : "/");
|
writer.String(path.empty() ? "/" : trim(path).data());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user