feat(finalmask): header-custom variables, sudoku UDP mask and noise reset ranges

xray-core 26.6 grew the finalmask surface the editor could not express,
and the finalmask watch drops any key without a registered field, so a
config written by hand lost these keys on the next save:

- header-custom items can capture their bytes into a variable, reuse one
  or emit a transform expression; a Kind select keeps each item to exactly
  one kind, as the core requires, and only parsed JSON reaches transform;
- TCP header-custom gains the errors group (the reply sent when a client
  group does not match), UDP header-custom its prefix/standalone mode;
- sudoku is offered as a UDP mask, and share links keep it in fm=;
- the noise reset is an Int32Range, so it now takes "60-120" as well.

The new golden fixture is saved unchanged by the outbound editor and
built by xray-core in TestGoldenStreamFixturesBuildInXray.
This commit is contained in:
MHSanaei
2026-10-11 15:27:19 +02:00
parent ec0a57fc4f
commit 1c050f872a
7 changed files with 531 additions and 52 deletions
@@ -38,6 +38,107 @@ exports[`FinalMaskStreamSettingsSchema fixtures > parses combined byte-stably 1`
}
`;
exports[`FinalMaskStreamSettingsSchema fixtures > parses header-custom-variables byte-stably 1`] = `
{
"tcp": [
{
"settings": {
"clients": [
[
{
"capture": "nonce",
"delay": 0,
"rand": 8,
"type": "array",
},
{
"delay": 0,
"packet": "HELLO",
"type": "str",
},
],
],
"errors": [
[
{
"delay": 0,
"packet": "DENIED",
"type": "str",
},
],
],
"servers": [
[
{
"delay": 0,
"reuse": "nonce",
},
{
"delay": 0,
"transform": {
"args": [
{
"bytes": "OK ",
"type": "str",
},
{
"reuse": "nonce",
},
],
"op": "concat",
},
},
],
],
},
"type": "header-custom",
},
],
"udp": [
{
"settings": {
"client": [
{
"capture": "token",
"rand": 8,
"type": "array",
},
],
"mode": "standalone",
"server": [
{
"reuse": "token",
},
],
},
"type": "header-custom",
},
{
"settings": {
"ascii": "prefer_entropy",
"paddingMax": 7,
"paddingMin": 2,
"password": "s3cr3t",
},
"type": "sudoku",
},
{
"settings": {
"noise": [
{
"delay": "10-16",
"rand": "10-20",
"type": "array",
},
],
"reset": "60-120",
},
"type": "noise",
},
],
}
`;
exports[`FinalMaskStreamSettingsSchema fixtures > parses quic-params byte-stably 1`] = `
{
"quicParams": {