mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
fix packet encoding (#774)
* feat(sub): get packet encoding from Clash.Meta's sub * fix: use "packetaddr" instead of "packet" * fix * fix --------- Co-authored-by: 2022-blake3-chacha8-poly1305 <139959885+xchacha20-ietf-poly1305@users.noreply.github.com>
This commit is contained in:
@@ -270,11 +270,11 @@ namespace NekoGui_sub {
|
||||
if (type == "vless") {
|
||||
bean->flow = Node2QString(proxy["flow"]);
|
||||
bean->password = Node2QString(proxy["uuid"]);
|
||||
// meta vless xudp
|
||||
auto xudp = proxy["xudp"];
|
||||
if (xudp.IsDefined() && !xudp.IsNull() && Node2Bool(xudp) == false) {
|
||||
bean->stream->packet_encoding = "";
|
||||
// meta packet encoding
|
||||
if (Node2Bool(proxy["packet-addr"])) {
|
||||
bean->stream->packet_encoding = "packetaddr";
|
||||
} else {
|
||||
// For VLESS, default to use xudp
|
||||
bean->stream->packet_encoding = "xudp";
|
||||
}
|
||||
} else {
|
||||
@@ -323,6 +323,10 @@ namespace NekoGui_sub {
|
||||
if (Node2Bool(proxy["tls"])) bean->stream->security = "tls";
|
||||
if (Node2Bool(proxy["skip-cert-verify"])) bean->stream->allow_insecure = true;
|
||||
|
||||
// meta packet encoding
|
||||
if (Node2Bool(proxy["xudp"])) bean->stream->packet_encoding = "xudp";
|
||||
if (Node2Bool(proxy["packet-addr"])) bean->stream->packet_encoding = "packetaddr";
|
||||
|
||||
// opts
|
||||
auto ws = NodeChild(proxy, {"ws-opts", "ws-opt"});
|
||||
if (ws.IsMap()) {
|
||||
|
||||
Reference in New Issue
Block a user