mirror of
				https://github.com/asdlokj1qpi233/subconverter.git
				synced 2025-10-31 05:42:31 +00:00 
			
		
		
		
	Fix the issue of incorrect conversion of VLESS reality in Singbox as the source. Fix the issue of missing SS nodes with the obfs type when converting to Singbox. (#4)
This commit is contained in:
		| @@ -501,6 +501,7 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo | |||||||
|                 } |                 } | ||||||
|                 switch (hash_(x.TransferProtocol)) { |                 switch (hash_(x.TransferProtocol)) { | ||||||
|                     case "tcp"_hash: |                     case "tcp"_hash: | ||||||
|  |                         singleproxy["network"] = x.TransferProtocol; | ||||||
|                         break; |                         break; | ||||||
|                     case "ws"_hash: |                     case "ws"_hash: | ||||||
|                         singleproxy["network"] = x.TransferProtocol; |                         singleproxy["network"] = x.TransferProtocol; | ||||||
| @@ -2166,7 +2167,7 @@ proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json, std::vector | |||||||
|                 if (!x.Plugin.empty() && !x.PluginOption.empty()) { |                 if (!x.Plugin.empty() && !x.PluginOption.empty()) { | ||||||
|                     if (x.Plugin == "simple-obfs") |                     if (x.Plugin == "simple-obfs") | ||||||
|                         x.Plugin = "obfs-local"; |                         x.Plugin = "obfs-local"; | ||||||
|                     if (x.Plugin != "obfs-local" || x.Plugin != "v2ray-plugin") { |                     if (x.Plugin != "obfs-local" && x.Plugin != "v2ray-plugin") { | ||||||
|                         continue; |                         continue; | ||||||
|                     } |                     } | ||||||
|                     proxy.AddMember("plugin", rapidjson::StringRef(x.Plugin.c_str()), allocator); |                     proxy.AddMember("plugin", rapidjson::StringRef(x.Plugin.c_str()), allocator); | ||||||
|   | |||||||
| @@ -2520,6 +2520,18 @@ void explodeSingbox(rapidjson::Value &outbounds, std::vector<Proxy> &nodes) { | |||||||
|                     if (tlsObj.HasMember("insecure") && tlsObj["insecure"].IsBool()) { |                     if (tlsObj.HasMember("insecure") && tlsObj["insecure"].IsBool()) { | ||||||
|                         scv = tlsObj["insecure"].GetBool(); |                         scv = tlsObj["insecure"].GetBool(); | ||||||
|                     } |                     } | ||||||
|  |                     if (tlsObj.HasMember("reality") && tlsObj["reality"].IsObject()) { | ||||||
|  |                         rapidjson::Value reality = tlsObj["reality"].GetObject(); | ||||||
|  |                         if (reality.HasMember("server_name") && reality["server_name"].IsString()) { | ||||||
|  |                             host = reality["server_name"].GetString(); | ||||||
|  |                         } | ||||||
|  |                         if (reality.HasMember("public_key") && reality["public_key"].IsString()) { | ||||||
|  |                             pbk = reality["public_key"].GetString(); | ||||||
|  |                         } | ||||||
|  |                         if (reality.HasMember("short_id") && reality["short_id"].IsString()) { | ||||||
|  |                             sid = reality["short_id"].GetString(); | ||||||
|  |                         } | ||||||
|  |                     } | ||||||
|                 } |                 } | ||||||
|                 switch (hash_(proxytype)) { |                 switch (hash_(proxytype)) { | ||||||
|                     case "vmess"_hash: |                     case "vmess"_hash: | ||||||
| @@ -2629,7 +2641,8 @@ void explodeSingbox(rapidjson::Value &outbounds, std::vector<Proxy> &nodes) { | |||||||
|                         auth = GetMember(singboxNode, "auth_str"); |                         auth = GetMember(singboxNode, "auth_str"); | ||||||
|                         type = GetMember(singboxNode, "network"); |                         type = GetMember(singboxNode, "network"); | ||||||
|                         obfsParam = GetMember(singboxNode, "obfs"); |                         obfsParam = GetMember(singboxNode, "obfs"); | ||||||
|                         hysteriaConstruct(node, group, ps, server, port, type, auth,"", host, up, down, alpn, obfsParam, insecure, ports, |                         hysteriaConstruct(node, group, ps, server, port, type, auth, "", host, up, down, alpn, | ||||||
|  |                                           obfsParam, insecure, ports, | ||||||
|                                           udp, tfo, scv); |                                           udp, tfo, scv); | ||||||
|                         break; |                         break; | ||||||
|                     case "hysteria2"_hash: |                     case "hysteria2"_hash: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user