add Hysteria,Hysteria2 support clash and singbox,add vless support clash.fix stash Hysteria2 config error.

This commit is contained in:
mzixofjsla
2023-12-14 19:28:08 +08:00
parent 81d9167840
commit 3cc58f38dd
7 changed files with 2944 additions and 2649 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -34,6 +34,7 @@ struct extra_settings
std::string quanx_dev_id;
tribool udp = tribool();
tribool tfo = tribool();
tribool xudp = tribool();
tribool skip_cert_verify = tribool();
tribool tls13 = tribool();
bool clash_classical_ruleset = false;

View File

@@ -9,8 +9,7 @@
using String = std::string;
using StringArray = std::vector<String>;
enum class ProxyType
{
enum class ProxyType {
Unknown,
Shadowsocks,
ShadowsocksR,
@@ -20,36 +19,44 @@ enum class ProxyType
HTTP,
HTTPS,
SOCKS5,
WireGuard
WireGuard,
VLESS,
Hysteria,
Hysteria2
};
inline String getProxyTypeName(ProxyType type)
{
switch(type)
{
case ProxyType::Shadowsocks:
return "SS";
case ProxyType::ShadowsocksR:
return "SSR";
case ProxyType::VMess:
return "VMess";
case ProxyType::Trojan:
return "Trojan";
case ProxyType::Snell:
return "Snell";
case ProxyType::HTTP:
return "HTTP";
case ProxyType::HTTPS:
return "HTTPS";
case ProxyType::SOCKS5:
return "SOCKS5";
default:
return "Unknown";
inline String getProxyTypeName(ProxyType type) {
switch (type) {
case ProxyType::Shadowsocks:
return "SS";
case ProxyType::ShadowsocksR:
return "SSR";
case ProxyType::VMess:
return "VMess";
case ProxyType::Trojan:
return "Trojan";
case ProxyType::Snell:
return "Snell";
case ProxyType::HTTP:
return "HTTP";
case ProxyType::HTTPS:
return "HTTPS";
case ProxyType::SOCKS5:
return "SOCKS5";
case ProxyType::WireGuard:
return "WireGuard";
case ProxyType::VLESS:
return "Vless";
case ProxyType::Hysteria:
return "Hysteria";
case ProxyType::Hysteria2:
return "Hysteria2";
default:
return "Unknown";
}
}
struct Proxy
{
struct Proxy {
ProxyType Type = ProxyType::Unknown;
uint32_t Id = 0;
uint32_t GroupId = 0;
@@ -81,6 +88,7 @@ struct Proxy
String QUICSecret;
tribool UDP;
tribool XUDP;
tribool TCPFastOpen;
tribool AllowInsecure;
tribool TLS13;
@@ -99,6 +107,19 @@ struct Proxy
uint16_t KeepAlive = 0;
String TestUrl;
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"
@@ -109,5 +130,8 @@ struct Proxy
#define TROJAN_DEFAULT_GROUP "TrojanProvider"
#define SNELL_DEFAULT_GROUP "SnellProvider"
#define WG_DEFAULT_GROUP "WireGuardProvider"
#define XRAY_DEFAULT_GROUP "XRayProvider"
#define HYSTERIA_DEFAULT_GROUP "HysteriaProvider"
#define HYSTERIA2_DEFAULT_GROUP "Hysteria2Provider"
#endif // PROXY_H_INCLUDED

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,9 @@ enum class ConfType
SUB,
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 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());
@@ -33,8 +35,14 @@ void explodeSS(std::string ss, Proxy &node);
void explodeTrojan(std::string trojan, Proxy &node);
void explodeQuan(const std::string &quan, 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 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
void explode(const std::string &link, Proxy &node);
void explodeSSD(std::string link, std::vector<Proxy> &nodes);

View File

@@ -1,6 +1,6 @@
#ifndef VERSION_H_INCLUDED
#define VERSION_H_INCLUDED
#define VERSION "v0.8.1"
#define VERSION "v0.8.2"
#endif // VERSION_H_INCLUDED