mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-02 17:52:19 +00:00
add Hysteria,Hysteria2 support clash and singbox,add vless support clash.fix stash Hysteria2 config error.
This commit is contained in:
1 parent
81d9167840
commit
3cc58f38dd
7 files changed
+2944
-2649
No files matched your search
@@ -9,7 +9,7 @@ Utility to convert between various proxy subscription formats.
|
|||||||
|
|
||||||
[Docker README](https://github.com/tindy2013/subconverter/blob/master/README-docker.md)
|
[Docker README](https://github.com/tindy2013/subconverter/blob/master/README-docker.md)
|
||||||
|
|
||||||
[中文文档](https://github.com/tindy2013/subconverter/blob/master/README-cn.md)1
|
[中文文档](https://github.com/tindy2013/subconverter/blob/master/README-cn.md)
|
||||||
|
|
||||||
- [subconverter](#subconverter)
|
- [subconverter](#subconverter)
|
||||||
- [Supported Types](#supported-types)
|
- [Supported Types](#supported-types)
|
||||||
|
|||||||
+1314
-1263
File diff suppressed because it is too large.
Load diff
@@ -34,6 +34,7 @@ struct extra_settings
|
|||||||
std::string quanx_dev_id;
|
std::string quanx_dev_id;
|
||||||
tribool udp = tribool();
|
tribool udp = tribool();
|
||||||
tribool tfo = tribool();
|
tribool tfo = tribool();
|
||||||
|
tribool xudp = tribool();
|
||||||
tribool skip_cert_verify = tribool();
|
tribool skip_cert_verify = tribool();
|
||||||
tribool tls13 = tribool();
|
tribool tls13 = tribool();
|
||||||
bool clash_classical_ruleset = false;
|
bool clash_classical_ruleset = false;
|
||||||
|
|||||||
+51
-27
@@ -9,8 +9,7 @@
|
|||||||
using String = std::string;
|
using String = std::string;
|
||||||
using StringArray = std::vector<String>;
|
using StringArray = std::vector<String>;
|
||||||
|
|
||||||
enum class ProxyType
|
enum class ProxyType {
|
||||||
{
|
|
||||||
Unknown,
|
Unknown,
|
||||||
Shadowsocks,
|
Shadowsocks,
|
||||||
ShadowsocksR,
|
ShadowsocksR,
|
||||||
@@ -20,36 +19,44 @@ enum class ProxyType
|
|||||||
HTTP,
|
HTTP,
|
||||||
HTTPS,
|
HTTPS,
|
||||||
SOCKS5,
|
SOCKS5,
|
||||||
WireGuard
|
WireGuard,
|
||||||
|
VLESS,
|
||||||
|
Hysteria,
|
||||||
|
Hysteria2
|
||||||
};
|
};
|
||||||
|
|
||||||
inline String getProxyTypeName(ProxyType type)
|
inline String getProxyTypeName(ProxyType type) {
|
||||||
{
|
switch (type) {
|
||||||
switch(type)
|
case ProxyType::Shadowsocks:
|
||||||
{
|
return "SS";
|
||||||
case ProxyType::Shadowsocks:
|
case ProxyType::ShadowsocksR:
|
||||||
return "SS";
|
return "SSR";
|
||||||
case ProxyType::ShadowsocksR:
|
case ProxyType::VMess:
|
||||||
return "SSR";
|
return "VMess";
|
||||||
case ProxyType::VMess:
|
case ProxyType::Trojan:
|
||||||
return "VMess";
|
return "Trojan";
|
||||||
case ProxyType::Trojan:
|
case ProxyType::Snell:
|
||||||
return "Trojan";
|
return "Snell";
|
||||||
case ProxyType::Snell:
|
case ProxyType::HTTP:
|
||||||
return "Snell";
|
return "HTTP";
|
||||||
case ProxyType::HTTP:
|
case ProxyType::HTTPS:
|
||||||
return "HTTP";
|
return "HTTPS";
|
||||||
case ProxyType::HTTPS:
|
case ProxyType::SOCKS5:
|
||||||
return "HTTPS";
|
return "SOCKS5";
|
||||||
case ProxyType::SOCKS5:
|
case ProxyType::WireGuard:
|
||||||
return "SOCKS5";
|
return "WireGuard";
|
||||||
default:
|
case ProxyType::VLESS:
|
||||||
return "Unknown";
|
return "Vless";
|
||||||
|
case ProxyType::Hysteria:
|
||||||
|
return "Hysteria";
|
||||||
|
case ProxyType::Hysteria2:
|
||||||
|
return "Hysteria2";
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Proxy
|
struct Proxy {
|
||||||
{
|
|
||||||
ProxyType Type = ProxyType::Unknown;
|
ProxyType Type = ProxyType::Unknown;
|
||||||
uint32_t Id = 0;
|
uint32_t Id = 0;
|
||||||
uint32_t GroupId = 0;
|
uint32_t GroupId = 0;
|
||||||
@@ -81,6 +88,7 @@ struct Proxy
|
|||||||
String QUICSecret;
|
String QUICSecret;
|
||||||
|
|
||||||
tribool UDP;
|
tribool UDP;
|
||||||
|
tribool XUDP;
|
||||||
tribool TCPFastOpen;
|
tribool TCPFastOpen;
|
||||||
tribool AllowInsecure;
|
tribool AllowInsecure;
|
||||||
tribool TLS13;
|
tribool TLS13;
|
||||||
@@ -99,6 +107,19 @@ struct Proxy
|
|||||||
uint16_t KeepAlive = 0;
|
uint16_t KeepAlive = 0;
|
||||||
String TestUrl;
|
String TestUrl;
|
||||||
String ClientId;
|
String ClientId;
|
||||||
|
|
||||||
|
String Auth;
|
||||||
|
String Alpn;
|
||||||
|
String UpMbps;
|
||||||
|
String DownMbps;
|
||||||
|
String Insecure;
|
||||||
|
String Fingerprint;
|
||||||
|
String OBFSPassword;
|
||||||
|
String GRPCServiceName;
|
||||||
|
String GRPCMode;
|
||||||
|
String ShortId;
|
||||||
|
String Flow;
|
||||||
|
bool FlowShow = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SS_DEFAULT_GROUP "SSProvider"
|
#define SS_DEFAULT_GROUP "SSProvider"
|
||||||
@@ -109,5 +130,8 @@ struct Proxy
|
|||||||
#define TROJAN_DEFAULT_GROUP "TrojanProvider"
|
#define TROJAN_DEFAULT_GROUP "TrojanProvider"
|
||||||
#define SNELL_DEFAULT_GROUP "SnellProvider"
|
#define SNELL_DEFAULT_GROUP "SnellProvider"
|
||||||
#define WG_DEFAULT_GROUP "WireGuardProvider"
|
#define WG_DEFAULT_GROUP "WireGuardProvider"
|
||||||
|
#define XRAY_DEFAULT_GROUP "XRayProvider"
|
||||||
|
#define HYSTERIA_DEFAULT_GROUP "HysteriaProvider"
|
||||||
|
#define HYSTERIA2_DEFAULT_GROUP "Hysteria2Provider"
|
||||||
|
|
||||||
#endif // PROXY_H_INCLUDED
|
#endif // PROXY_H_INCLUDED
|
||||||
+1567
-1356
File diff suppressed because it is too large.
Load diff
@@ -19,7 +19,9 @@ enum class ConfType
|
|||||||
SUB,
|
SUB,
|
||||||
Local
|
Local
|
||||||
};
|
};
|
||||||
|
void hysteriaConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add, const std::string &port, const std::string &type, const std::string &auth, const std::string &host, const std::string &up, const std::string &down, const std::string &alpn, const std::string &obfsParam, const std::string &insecure ,tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||||
|
void hysteria2Construct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add, const std::string &port, const std::string &password, const std::string &host, const std::string &up, const std::string &down, const std::string &alpn, const std::string &obfsParam, const std::string &obfsPassword, const std::string &insecure ,tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||||
|
void vlessConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add, const std::string &port, const std::string &type, const std::string &id, const std::string &aid, const std::string &net, const std::string &cipher, const std::string &flow, const std::string &mode, const std::string &path, const std::string &host, const std::string &edge, const std::string &tls,const std::string &pkd, const std::string &sid, const std::string &fp, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||||
void vmessConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add, const std::string &port, const std::string &type, const std::string &id, const std::string &aid, const std::string &net, const std::string &cipher, const std::string &path, const std::string &host, const std::string &edge, const std::string &tls, const std::string &sni, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
void vmessConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add, const std::string &port, const std::string &type, const std::string &id, const std::string &aid, const std::string &net, const std::string &cipher, const std::string &path, const std::string &host, const std::string &edge, const std::string &tls, const std::string &sni, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||||
void ssrConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &protocol, const std::string &method, const std::string &obfs, const std::string &password, const std::string &obfsparam, const std::string &protoparam, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool());
|
void ssrConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &protocol, const std::string &method, const std::string &obfs, const std::string &password, const std::string &obfsparam, const std::string &protoparam, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool());
|
||||||
void ssConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &password, const std::string &method, const std::string &plugin, const std::string &pluginopts, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
void ssConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &password, const std::string &method, const std::string &plugin, const std::string &pluginopts, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||||
@@ -33,8 +35,14 @@ void explodeSS(std::string ss, Proxy &node);
|
|||||||
void explodeTrojan(std::string trojan, Proxy &node);
|
void explodeTrojan(std::string trojan, Proxy &node);
|
||||||
void explodeQuan(const std::string &quan, Proxy &node);
|
void explodeQuan(const std::string &quan, Proxy &node);
|
||||||
void explodeStdVMess(std::string vmess, Proxy &node);
|
void explodeStdVMess(std::string vmess, Proxy &node);
|
||||||
|
void explodeStdVless(std::string vless, Proxy &node);
|
||||||
|
void explodeStdHysteria(std::string hysteria, Proxy &node);
|
||||||
|
void explodeStdHysteria2(std::string hysteria2, Proxy &node);
|
||||||
void explodeShadowrocket(std::string kit, Proxy &node);
|
void explodeShadowrocket(std::string kit, Proxy &node);
|
||||||
void explodeKitsunebi(std::string kit, Proxy &node);
|
void explodeKitsunebi(std::string kit, Proxy &node);
|
||||||
|
void explodeVless(std::string vless, Proxy &node);
|
||||||
|
void explodeHysteria(std::string hysteria, Proxy &node);
|
||||||
|
void explodeHysteria2(std::string hysteria2, Proxy &node);
|
||||||
/// Parse a link
|
/// Parse a link
|
||||||
void explode(const std::string &link, Proxy &node);
|
void explode(const std::string &link, Proxy &node);
|
||||||
void explodeSSD(std::string link, std::vector<Proxy> &nodes);
|
void explodeSSD(std::string link, std::vector<Proxy> &nodes);
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#ifndef VERSION_H_INCLUDED
|
#ifndef VERSION_H_INCLUDED
|
||||||
#define VERSION_H_INCLUDED
|
#define VERSION_H_INCLUDED
|
||||||
|
|
||||||
#define VERSION "v0.8.1"
|
#define VERSION "v0.8.2"
|
||||||
|
|
||||||
#endif // VERSION_H_INCLUDED
|
#endif // VERSION_H_INCLUDED
|
||||||
Reference in new issue
Block a user