Fixed QX vmess method auto

This commit is contained in:
Peng-YM 2022-06-16 18:47:40 +08:00
parent 4b73a1494b
commit 1b526414cd
9 changed files with 30 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -110,7 +110,10 @@ port = digits:[0-9]+ {
throw new Error("Invalid port number: " + port);
}
method = comma cipher:cipher { proxy.cipher = cipher; }
method = comma cipher:cipher {
if (cipher !== 'none') proxy.cipher = cipher;
else proxy.cipher = 'auto';
}
cipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");
username = & {

View File

@ -108,7 +108,10 @@ port = digits:[0-9]+ {
throw new Error("Invalid port number: " + port);
}
method = comma cipher:cipher { proxy.cipher = cipher; }
method = comma cipher:cipher {
if (cipher !== 'none') proxy.cipher = cipher;
else proxy.cipher = 'auto';
}
cipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");
username = & {

View File

@ -134,7 +134,10 @@ username = comma "username" equals username:[^=,]+ { proxy.username = username.j
password = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }
uuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }
method = comma "method" equals cipher:cipher { proxy.cipher = cipher };
method = comma "method" equals cipher:cipher {
if (cipher !== 'none') proxy.cipher = cipher;
else proxy.cipher = 'auto';
};
cipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");
aead = comma "aead" equals flag:bool { proxy.alterId = 0; }

View File

@ -132,7 +132,10 @@ username = comma "username" equals username:[^=,]+ { proxy.username = username.j
password = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }
uuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }
method = comma "method" equals cipher:cipher { proxy.cipher = cipher };
method = comma "method" equals cipher:cipher {
if (cipher !== 'none') proxy.cipher = cipher;
else proxy.cipher = 'auto';
};
cipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");
aead = comma "aead" equals flag:bool { proxy.alterId = 0; }

View File

@ -146,7 +146,8 @@ vmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join("");
vmess_aead = comma "vmess-aead" equals flag:bool { proxy.alterId = 0; }
method = comma "encrypt-method" equals cipher:cipher {
proxy.cipher = cipher;
if (cipher !== 'none') proxy.cipher = cipher;
else proxy.cipher = 'auto';
}
cipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");

View File

@ -144,7 +144,8 @@ vmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join("");
vmess_aead = comma "vmess-aead" equals flag:bool { proxy.alterId = 0; }
method = comma "encrypt-method" equals cipher:cipher {
proxy.cipher = cipher;
if (cipher !== 'none') proxy.cipher = cipher;
else proxy.cipher = 'auto';
}
cipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");

View File

@ -154,7 +154,12 @@ function vmess(proxy) {
const appendIfPresent = result.appendIfPresent.bind(result);
append(`vmess=${proxy.server}:${proxy.port}`);
append(`,method=${proxy.cipher}`);
if (proxy.cipher === 'auto') {
append(`,method=none`);
} else {
append(`,method=${proxy.cipher}`);
}
append(`,password=${proxy.uuid}`);
// obfs

File diff suppressed because one or more lines are too long