mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 02:02:24 +00:00
Enhancements
Add better error handling. Add support for version field of Snell nodes. Optimize codes.
This commit is contained in:
7 files changed
+41
-24
No files matched your search
@@ -162,7 +162,7 @@ int addNodes(std::string link, std::vector<Proxy> &allNodes, int groupID, parse_
|
||||
writeLog(LOG_TYPE_INFO, "Parsing subscription data...");
|
||||
if(explodeConfContent(strSub, nodes) == 0)
|
||||
{
|
||||
writeLog(LOG_TYPE_ERROR, "Invalid subscription!");
|
||||
writeLog(LOG_TYPE_ERROR, "Invalid subscription: '" + link + "'!");
|
||||
return -1;
|
||||
}
|
||||
if(startsWith(strSub, "ssd://"))
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include <numeric>
|
||||
#include <cmath>
|
||||
#include <climits>
|
||||
#include <rapidjson/writer.h>
|
||||
#include <rapidjson/document.h>
|
||||
#include <rapidjson/error/en.h>
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#include "../../config/regmatch.h"
|
||||
#include "../../generator/config/subexport.h"
|
||||
@@ -295,7 +291,7 @@ void proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGr
|
||||
case ProxyType::VMess:
|
||||
singleproxy["type"] = "vmess";
|
||||
singleproxy["uuid"] = x.UserId;
|
||||
singleproxy["alterId"] = static_cast<uint32_t>(x.AlterId);
|
||||
singleproxy["alterId"] = x.AlterId;
|
||||
singleproxy["cipher"] = x.EncryptMethod;
|
||||
singleproxy["tls"] = x.TLSSecure;
|
||||
if(!scv.is_undef())
|
||||
@@ -433,6 +429,8 @@ void proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGr
|
||||
case ProxyType::Snell:
|
||||
singleproxy["type"] = "snell";
|
||||
singleproxy["psk"] = x.Password;
|
||||
if(x.AlterId != 0)
|
||||
singleproxy["version"] = x.AlterId;
|
||||
if(!x.OBFS.empty())
|
||||
{
|
||||
singleproxy["obfs-opts"]["mode"] = x.OBFS;
|
||||
|
||||
Reference in new issue
Block a user