mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-10-28 20:32:42 +00:00
support vless reality for Loon,(#22)
This commit is contained in:
@@ -2107,13 +2107,13 @@ proxyToLoon(std::vector<Proxy> &nodes, const std::string &base_conf,
|
|||||||
std::string &hostname = x.Hostname, &username = x.Username, &password = x.Password, &method = x.EncryptMethod, &
|
std::string &hostname = x.Hostname, &username = x.Username, &password = x.Password, &method = x.EncryptMethod, &
|
||||||
plugin = x.Plugin, &pluginopts = x.PluginOption, &id = x.UserId, &transproto = x.TransferProtocol, &host
|
plugin = x.Plugin, &pluginopts = x.PluginOption, &id = x.UserId, &transproto = x.TransferProtocol, &host
|
||||||
= x.Host, &path = x.Path, &protocol = x.Protocol, &protoparam = x.ProtocolParam, &obfs = x.OBFS, &
|
= x.Host, &path = x.Path, &protocol = x.Protocol, &protoparam = x.ProtocolParam, &obfs = x.OBFS, &
|
||||||
obfsparam = x.OBFSParam;
|
obfsparam = x.OBFSParam, flow = x.Flow, pk = x.PublicKey,shortId = x.ShortId,sni = x.ServerName;
|
||||||
std::string port = std::to_string(x.Port), aid = std::to_string(x.AlterId);
|
std::string port = std::to_string(x.Port), aid = std::to_string(x.AlterId);
|
||||||
bool &tlssecure = x.TLSSecure;
|
bool &tlssecure = x.TLSSecure;
|
||||||
|
|
||||||
tribool scv = ext.skip_cert_verify;
|
tribool scv = ext.skip_cert_verify;
|
||||||
scv.define(x.AllowInsecure);
|
scv.define(x.AllowInsecure);
|
||||||
|
tribool udp = x.UDP.is_undef()?ext.udp.is_undef()?false:ext.udp:x.UDP;
|
||||||
std::string proxy;
|
std::string proxy;
|
||||||
|
|
||||||
switch (x.Type) {
|
switch (x.Type) {
|
||||||
@@ -2148,6 +2148,22 @@ proxyToLoon(std::vector<Proxy> &nodes, const std::string &base_conf,
|
|||||||
if (!scv.is_undef())
|
if (!scv.is_undef())
|
||||||
proxy += ",skip-cert-verify=" + std::string(scv.get() ? "true" : "false");
|
proxy += ",skip-cert-verify=" + std::string(scv.get() ? "true" : "false");
|
||||||
break;
|
break;
|
||||||
|
case ProxyType::VLESS:
|
||||||
|
if (flow != "xtls-rprx-vision") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
proxy = "VLESS," + hostname + "," + port + ",\"" + id + "\",flow=" + flow + ",public-key=\""+pk+"\",shortid="+shortId+",udp="+(udp.get() ? "true" : "false")+",over-tls="+(tlssecure ? "true" : "false")+",sni="+sni;
|
||||||
|
|
||||||
|
switch (hash_(transproto)) {
|
||||||
|
case "tcp"_hash:
|
||||||
|
proxy += ",transport=tcp";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!scv.is_undef())
|
||||||
|
proxy += ",skip-cert-verify=" + std::string(scv.get() ? "true" : "false");
|
||||||
|
break;
|
||||||
case ProxyType::ShadowsocksR:
|
case ProxyType::ShadowsocksR:
|
||||||
proxy = "ShadowsocksR," + hostname + "," + port + "," + method + ",\"" + password + "\",protocol=" +
|
proxy = "ShadowsocksR," + hostname + "," + port + "," + method + ",\"" + password + "\",protocol=" +
|
||||||
protocol + ",protocol-param=" + protoparam + ",obfs=" + obfs + ",obfs-param=" + obfsparam;
|
protocol + ",protocol-param=" + protoparam + ",obfs=" + obfs + ",obfs-param=" + obfsparam;
|
||||||
|
|||||||
Reference in New Issue
Block a user