mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-01 09:14:15 +00:00
feat: support QuanX VLESS Reality export
This commit is contained in:
1 parent
7640244536
commit
bfb6ca31a4
1 file changed
+46
-14
@@ -1788,7 +1788,7 @@ void proxyToQuanX(std::vector<Proxy> &nodes, INIReader &ini, std::vector<Ruleset
|
||||
std::string &hostname = x.Hostname, &method = x.EncryptMethod, &id = x.UserId, &transproto = x.TransferProtocol,
|
||||
&host = x.Host, &path = x.Path, &password = x.Password, &plugin = x.Plugin, &pluginopts = x.PluginOption
|
||||
, &protocol = x.Protocol, &protoparam = x.ProtocolParam, &obfs = x.OBFS, &obfsparam = x.OBFSParam, &
|
||||
username = x.Username;
|
||||
username = x.Username, &sni = x.ServerName, &publickey = x.PublicKey, &shortid = x.ShortId, &flow = x.Flow;
|
||||
std::string port = std::to_string(x.Port);
|
||||
bool &tlssecure = x.TLSSecure;
|
||||
|
||||
@@ -1820,23 +1820,55 @@ void proxyToQuanX(std::vector<Proxy> &nodes, INIReader &ini, std::vector<Ruleset
|
||||
proxyStr += ", obfs=over-tls, obfs-host=" + host;
|
||||
break;
|
||||
case ProxyType::VLESS:
|
||||
if (method == "auto")
|
||||
method = "none";
|
||||
else
|
||||
method = "none";
|
||||
method = "none";
|
||||
proxyStr = "vless = " + hostname + ":" + port + ", method=" + method + ", password=" + id;
|
||||
if (x.AlterId != 0)
|
||||
proxyStr += ", aead=false";
|
||||
if (tlssecure && !tls13.is_undef())
|
||||
proxyStr += ", tls13=" + std::string(tls13 ? "true" : "false");
|
||||
if (transproto == "ws") {
|
||||
if (tlssecure)
|
||||
proxyStr += ", obfs=wss";
|
||||
else
|
||||
proxyStr += ", obfs=ws";
|
||||
proxyStr += ", obfs-host=" + host + ", obfs-uri=" + path;
|
||||
} else if (tlssecure)
|
||||
proxyStr += ", obfs=over-tls, obfs-host=" + host;
|
||||
proxyStr += tlssecure ? ", obfs=wss" : ", obfs=ws";
|
||||
|
||||
if (tlssecure && !publickey.empty() && sni.empty())
|
||||
writeLog(0, "Quantumult X vless reality: public key present but SNI missing; skipping reality output.", LOG_LEVEL_WARNING);
|
||||
if (tlssecure && !shortid.empty() && publickey.empty())
|
||||
writeLog(0, "Quantumult X vless reality: shortid present but public key missing; skipping reality output.", LOG_LEVEL_WARNING);
|
||||
|
||||
if (tlssecure && !publickey.empty() && !sni.empty())
|
||||
proxyStr += ", obfs-host=" + sni;
|
||||
else if (!host.empty())
|
||||
proxyStr += ", obfs-host=" + host;
|
||||
if (!path.empty())
|
||||
proxyStr += ", obfs-uri=" + path;
|
||||
if (tlssecure && !publickey.empty() && !sni.empty()) {
|
||||
proxyStr += ", reality-base64-pubkey=" + publickey;
|
||||
if (!shortid.empty())
|
||||
proxyStr += ", reality-hex-shortid=" + shortid;
|
||||
}
|
||||
} else if (transproto == "http") {
|
||||
proxyStr += ", obfs=http";
|
||||
if (!host.empty())
|
||||
proxyStr += ", obfs-host=" + host;
|
||||
if (!path.empty())
|
||||
proxyStr += ", obfs-uri=" + path;
|
||||
} else if (tlssecure) {
|
||||
proxyStr += ", obfs=over-tls";
|
||||
|
||||
if (!publickey.empty() && sni.empty())
|
||||
writeLog(0, "Quantumult X vless reality: public key present but SNI missing; skipping reality output.", LOG_LEVEL_WARNING);
|
||||
if (!shortid.empty() && publickey.empty())
|
||||
writeLog(0, "Quantumult X vless reality: shortid present but public key missing; skipping reality output.", LOG_LEVEL_WARNING);
|
||||
|
||||
if (!publickey.empty() && !sni.empty()) {
|
||||
proxyStr += ", obfs-host=" + sni;
|
||||
proxyStr += ", reality-base64-pubkey=" + publickey;
|
||||
if (!shortid.empty())
|
||||
proxyStr += ", reality-hex-shortid=" + shortid;
|
||||
if (!flow.empty())
|
||||
proxyStr += ", vless-flow=" + flow;
|
||||
} else if (!sni.empty())
|
||||
proxyStr += ", obfs-host=" + sni;
|
||||
else if (!host.empty())
|
||||
proxyStr += ", obfs-host=" + host;
|
||||
}
|
||||
break;
|
||||
case ProxyType::Shadowsocks:
|
||||
proxyStr =
|
||||
|
||||
Reference in new issue
Block a user