mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-01 17:25:02 +00:00
Add singbox parser vmess.Change README.md
This commit is contained in:
1 parent
089f782177
commit
359d9794a8
2 files changed
+17
-3
No files matched your search
@@ -62,6 +62,7 @@ services:
|
|||||||
| V2Ray | ✓ | ✓ | v2ray |
|
| V2Ray | ✓ | ✓ | v2ray |
|
||||||
| Telegram-liked HTTP/Socks 5 links | ✓ | × | Only as source |
|
| Telegram-liked HTTP/Socks 5 links | ✓ | × | Only as source |
|
||||||
| Singbox | × | ✓ | singbox |
|
| Singbox | × | ✓ | singbox |
|
||||||
|
|
||||||
Notice:
|
Notice:
|
||||||
|
|
||||||
1. Shadowrocket users should use `ss`, `ssr` or `v2ray` as target.
|
1. Shadowrocket users should use `ss`, `ssr` or `v2ray` as target.
|
||||||
|
|||||||
@@ -2447,6 +2447,7 @@ int explodeConfContent(const std::string &content, std::vector<Proxy> &nodes) {
|
|||||||
|
|
||||||
return !nodes.empty();
|
return !nodes.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void explodeSingbox(rapidjson::Value& outbounds, std::vector<Proxy> &nodes){
|
void explodeSingbox(rapidjson::Value& outbounds, std::vector<Proxy> &nodes){
|
||||||
std::string proxytype, ps, server, port, cipher, group, password = "",ports, tempPassword; //common
|
std::string proxytype, ps, server, port, cipher, group, password = "",ports, tempPassword; //common
|
||||||
std::string type = "none", id, aid = "0", net = "tcp", path, host, edge, tls, sni; //vmess
|
std::string type = "none", id, aid = "0", net = "tcp", path, host, edge, tls, sni; //vmess
|
||||||
@@ -2462,11 +2463,23 @@ void explodeSingbox(rapidjson::Value& outbounds, std::vector<Proxy> &nodes){
|
|||||||
tribool udp, tfo, scv;
|
tribool udp, tfo, scv;
|
||||||
for (rapidjson::SizeType i = 0; i < outbounds.Size(); ++i) {
|
for (rapidjson::SizeType i = 0; i < outbounds.Size(); ++i) {
|
||||||
if (outbounds[i].IsObject()) {
|
if (outbounds[i].IsObject()) {
|
||||||
rapidjson::Value node = outbounds[i].GetObject();
|
rapidjson::Value singboxNode = outbounds[i].GetObject();
|
||||||
if (node.HasMember("type") && node["type"].IsString()) {
|
if (singboxNode.HasMember("type") && singboxNode["type"].IsString()) {
|
||||||
std::string singboxType = node["type"].GetString();
|
Proxy node;
|
||||||
|
std::string singboxType = singboxNode["type"].GetString();
|
||||||
|
ps = GetMember(singboxNode,"tag");
|
||||||
|
server = GetMember(singboxNode,"server");
|
||||||
|
port = GetMember(singboxNode,"server_port");
|
||||||
switch (hash_(singboxType)) {
|
switch (hash_(singboxType)) {
|
||||||
case "vmess"_hash:
|
case "vmess"_hash:
|
||||||
|
id = GetMember(singboxNode,"uuid");
|
||||||
|
if (id.length() < 36) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
aid = GetMember(singboxNode,"alter_id");
|
||||||
|
cipher = GetMember(singboxNode,"security");
|
||||||
|
vmessConstruct(node, group, ps, server, port, "", id, aid, net, cipher, path, host, edge, tls, sni, udp,
|
||||||
|
tfo, scv);
|
||||||
break;
|
break;
|
||||||
case "shadowsocks"_hash:
|
case "shadowsocks"_hash:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in new issue
Block a user