@gozargah/xray-schema 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -120,17 +120,18 @@ declare const inbound: z.ZodDiscriminatedUnion<[z.ZodObject<{
120
120
  }>>>;
121
121
  level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
122
122
  email: z.ZodOptional<z.ZodString>;
123
- method: z.ZodEnum<{
124
- "2022-blake3-aes-128-gcm": "2022-blake3-aes-128-gcm";
125
- "2022-blake3-aes-256-gcm": "2022-blake3-aes-256-gcm";
126
- "2022-blake3-chacha20-poly1305": "2022-blake3-chacha20-poly1305";
127
- }>;
123
+ method: z.ZodUnion<[z.ZodLiteral<"2022-blake3-aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"2022-blake3-aes-256-gcm">, z.ZodLiteral<"2022-blake3-chacha20-poly1305">]>]>;
128
124
  password: z.ZodString;
129
125
  users: z.ZodOptional<z.ZodArray<z.ZodObject<{
130
126
  password: z.ZodOptional<z.ZodString>;
131
127
  level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
132
128
  email: z.ZodString;
133
129
  }, z.core.$strip>>>;
130
+ clients: z.ZodOptional<z.ZodArray<z.ZodObject<{
131
+ password: z.ZodOptional<z.ZodString>;
132
+ level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
133
+ email: z.ZodString;
134
+ }, z.core.$strip>>>;
134
135
  }, z.core.$strip>, z.ZodObject<{
135
136
  network: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
136
137
  tcp: "tcp";
@@ -140,30 +141,18 @@ declare const inbound: z.ZodDiscriminatedUnion<[z.ZodObject<{
140
141
  level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
141
142
  password: z.ZodOptional<z.ZodString>;
142
143
  email: z.ZodOptional<z.ZodString>;
143
- method: z.ZodEnum<{
144
- "": "";
145
- none: "none";
146
- "aes-256-gcm": "aes-256-gcm";
147
- "aes-128-gcm": "aes-128-gcm";
148
- "chacha20-poly1305": "chacha20-poly1305";
149
- "chacha20-ietf-poly1305": "chacha20-ietf-poly1305";
150
- "xchacha20-poly1305": "xchacha20-poly1305";
151
- "xchacha20-ietf-poly1305": "xchacha20-ietf-poly1305";
152
- }>;
144
+ method: z.ZodUnion<[z.ZodLiteral<"aes-256-gcm">, z.ZodUnion<[z.ZodLiteral<"aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"chacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"chacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"">]>]>]>]>]>]>]>;
153
145
  users: z.ZodOptional<z.ZodArray<z.ZodObject<{
154
146
  password: z.ZodOptional<z.ZodString>;
155
147
  level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
156
148
  email: z.ZodString;
157
- method: z.ZodOptional<z.ZodEnum<{
158
- "": "";
159
- none: "none";
160
- "aes-256-gcm": "aes-256-gcm";
161
- "aes-128-gcm": "aes-128-gcm";
162
- "chacha20-poly1305": "chacha20-poly1305";
163
- "chacha20-ietf-poly1305": "chacha20-ietf-poly1305";
164
- "xchacha20-poly1305": "xchacha20-poly1305";
165
- "xchacha20-ietf-poly1305": "xchacha20-ietf-poly1305";
166
- }>>;
149
+ method: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"aes-256-gcm">, z.ZodUnion<[z.ZodLiteral<"aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"chacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"chacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"">]>]>]>]>]>]>]>>;
150
+ }, z.core.$strip>>>;
151
+ clients: z.ZodOptional<z.ZodArray<z.ZodObject<{
152
+ password: z.ZodOptional<z.ZodString>;
153
+ level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
154
+ email: z.ZodString;
155
+ method: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"aes-256-gcm">, z.ZodUnion<[z.ZodLiteral<"aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"chacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"chacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"">]>]>]>]>]>]>]>>;
167
156
  }, z.core.$strip>>>;
168
157
  }, z.core.$strip>], "method">;
169
158
  }, z.core.$strip>, z.ZodObject<{
@@ -697,17 +686,18 @@ declare const xraySchema: z.ZodObject<{
697
686
  }>>>;
698
687
  level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
699
688
  email: z.ZodOptional<z.ZodString>;
700
- method: z.ZodEnum<{
701
- "2022-blake3-aes-128-gcm": "2022-blake3-aes-128-gcm";
702
- "2022-blake3-aes-256-gcm": "2022-blake3-aes-256-gcm";
703
- "2022-blake3-chacha20-poly1305": "2022-blake3-chacha20-poly1305";
704
- }>;
689
+ method: z.ZodUnion<[z.ZodLiteral<"2022-blake3-aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"2022-blake3-aes-256-gcm">, z.ZodLiteral<"2022-blake3-chacha20-poly1305">]>]>;
705
690
  password: z.ZodString;
706
691
  users: z.ZodOptional<z.ZodArray<z.ZodObject<{
707
692
  password: z.ZodOptional<z.ZodString>;
708
693
  level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
709
694
  email: z.ZodString;
710
695
  }, z.core.$strip>>>;
696
+ clients: z.ZodOptional<z.ZodArray<z.ZodObject<{
697
+ password: z.ZodOptional<z.ZodString>;
698
+ level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
699
+ email: z.ZodString;
700
+ }, z.core.$strip>>>;
711
701
  }, z.core.$strip>, z.ZodObject<{
712
702
  network: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
713
703
  tcp: "tcp";
@@ -717,30 +707,18 @@ declare const xraySchema: z.ZodObject<{
717
707
  level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
718
708
  password: z.ZodOptional<z.ZodString>;
719
709
  email: z.ZodOptional<z.ZodString>;
720
- method: z.ZodEnum<{
721
- "": "";
722
- none: "none";
723
- "aes-256-gcm": "aes-256-gcm";
724
- "aes-128-gcm": "aes-128-gcm";
725
- "chacha20-poly1305": "chacha20-poly1305";
726
- "chacha20-ietf-poly1305": "chacha20-ietf-poly1305";
727
- "xchacha20-poly1305": "xchacha20-poly1305";
728
- "xchacha20-ietf-poly1305": "xchacha20-ietf-poly1305";
729
- }>;
710
+ method: z.ZodUnion<[z.ZodLiteral<"aes-256-gcm">, z.ZodUnion<[z.ZodLiteral<"aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"chacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"chacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"">]>]>]>]>]>]>]>;
730
711
  users: z.ZodOptional<z.ZodArray<z.ZodObject<{
731
712
  password: z.ZodOptional<z.ZodString>;
732
713
  level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
733
714
  email: z.ZodString;
734
- method: z.ZodOptional<z.ZodEnum<{
735
- "": "";
736
- none: "none";
737
- "aes-256-gcm": "aes-256-gcm";
738
- "aes-128-gcm": "aes-128-gcm";
739
- "chacha20-poly1305": "chacha20-poly1305";
740
- "chacha20-ietf-poly1305": "chacha20-ietf-poly1305";
741
- "xchacha20-poly1305": "xchacha20-poly1305";
742
- "xchacha20-ietf-poly1305": "xchacha20-ietf-poly1305";
743
- }>>;
715
+ method: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"aes-256-gcm">, z.ZodUnion<[z.ZodLiteral<"aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"chacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"chacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"">]>]>]>]>]>]>]>>;
716
+ }, z.core.$strip>>>;
717
+ clients: z.ZodOptional<z.ZodArray<z.ZodObject<{
718
+ password: z.ZodOptional<z.ZodString>;
719
+ level: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
720
+ email: z.ZodString;
721
+ method: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"aes-256-gcm">, z.ZodUnion<[z.ZodLiteral<"aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"chacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"chacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"">]>]>]>]>]>]>]>>;
744
722
  }, z.core.$strip>>>;
745
723
  }, z.core.$strip>], "method">;
746
724
  }, z.core.$strip>, z.ZodObject<{
@@ -1256,20 +1234,7 @@ declare const xraySchema: z.ZodObject<{
1256
1234
  port: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>;
1257
1235
  email: z.ZodOptional<z.ZodString>;
1258
1236
  password: z.ZodDefault<z.ZodString>;
1259
- method: z.ZodUnion<readonly [z.ZodEnum<{
1260
- "2022-blake3-aes-128-gcm": "2022-blake3-aes-128-gcm";
1261
- "2022-blake3-aes-256-gcm": "2022-blake3-aes-256-gcm";
1262
- "2022-blake3-chacha20-poly1305": "2022-blake3-chacha20-poly1305";
1263
- }>, z.ZodEnum<{
1264
- "": "";
1265
- none: "none";
1266
- "aes-256-gcm": "aes-256-gcm";
1267
- "aes-128-gcm": "aes-128-gcm";
1268
- "chacha20-poly1305": "chacha20-poly1305";
1269
- "chacha20-ietf-poly1305": "chacha20-ietf-poly1305";
1270
- "xchacha20-poly1305": "xchacha20-poly1305";
1271
- "xchacha20-ietf-poly1305": "xchacha20-ietf-poly1305";
1272
- }>]>;
1237
+ method: z.ZodUnion<readonly [z.ZodUnion<[z.ZodLiteral<"2022-blake3-aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"2022-blake3-aes-256-gcm">, z.ZodLiteral<"2022-blake3-chacha20-poly1305">]>]>, z.ZodUnion<[z.ZodLiteral<"aes-256-gcm">, z.ZodUnion<[z.ZodLiteral<"aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"chacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"chacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"">]>]>]>]>]>]>]>]>;
1273
1238
  uot: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1274
1239
  UoTVersion: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>]>>>;
1275
1240
  level: z.ZodOptional<z.ZodDefault<z.ZodInt>>;
@@ -1279,20 +1244,7 @@ declare const xraySchema: z.ZodObject<{
1279
1244
  port: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>;
1280
1245
  email: z.ZodOptional<z.ZodString>;
1281
1246
  password: z.ZodDefault<z.ZodString>;
1282
- method: z.ZodUnion<readonly [z.ZodEnum<{
1283
- "2022-blake3-aes-128-gcm": "2022-blake3-aes-128-gcm";
1284
- "2022-blake3-aes-256-gcm": "2022-blake3-aes-256-gcm";
1285
- "2022-blake3-chacha20-poly1305": "2022-blake3-chacha20-poly1305";
1286
- }>, z.ZodEnum<{
1287
- "": "";
1288
- none: "none";
1289
- "aes-256-gcm": "aes-256-gcm";
1290
- "aes-128-gcm": "aes-128-gcm";
1291
- "chacha20-poly1305": "chacha20-poly1305";
1292
- "chacha20-ietf-poly1305": "chacha20-ietf-poly1305";
1293
- "xchacha20-poly1305": "xchacha20-poly1305";
1294
- "xchacha20-ietf-poly1305": "xchacha20-ietf-poly1305";
1295
- }>]>;
1247
+ method: z.ZodUnion<readonly [z.ZodUnion<[z.ZodLiteral<"2022-blake3-aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"2022-blake3-aes-256-gcm">, z.ZodLiteral<"2022-blake3-chacha20-poly1305">]>]>, z.ZodUnion<[z.ZodLiteral<"aes-256-gcm">, z.ZodUnion<[z.ZodLiteral<"aes-128-gcm">, z.ZodUnion<[z.ZodLiteral<"chacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"chacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-poly1305">, z.ZodUnion<[z.ZodLiteral<"xchacha20-ietf-poly1305">, z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"">]>]>]>]>]>]>]>]>;
1296
1248
  uot: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1297
1249
  UoTVersion: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>]>>>;
1298
1250
  level: z.ZodOptional<z.ZodDefault<z.ZodInt>>;
@@ -1435,7 +1387,7 @@ declare const xraySchema: z.ZodObject<{
1435
1387
  }>>>;
1436
1388
  }, z.core.$strip>>;
1437
1389
  protocol: z.ZodLiteral<"vless">;
1438
- settings: z.ZodObject<{
1390
+ settings: z.ZodUnion<[z.ZodObject<{
1439
1391
  address: z.ZodString;
1440
1392
  port: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>;
1441
1393
  id: z.ZodString;
@@ -1462,7 +1414,22 @@ declare const xraySchema: z.ZodObject<{
1462
1414
  routeOnly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1463
1415
  }, z.core.$strip>>;
1464
1416
  }, z.core.$strip>>;
1465
- }, z.core.$strip>;
1417
+ }, z.core.$strip>, z.ZodObject<{
1418
+ vnext: z.ZodArray<z.ZodObject<{
1419
+ address: z.ZodString;
1420
+ port: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>;
1421
+ users: z.ZodArray<z.ZodObject<{
1422
+ id: z.ZodString;
1423
+ encryption: z.ZodDefault<z.ZodString>;
1424
+ flow: z.ZodOptional<z.ZodEnum<{
1425
+ "": "";
1426
+ "xtls-rprx-vision": "xtls-rprx-vision";
1427
+ "xtls-rprx-vision-udp443": "xtls-rprx-vision-udp443";
1428
+ }>>;
1429
+ level: z.ZodOptional<z.ZodDefault<z.ZodInt>>;
1430
+ }, z.core.$strip>>;
1431
+ }, z.core.$strip>>;
1432
+ }, z.core.$strip>]>;
1466
1433
  }, z.core.$strip>, z.ZodObject<{
1467
1434
  sendThrough: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEnum<{
1468
1435
  origin: "origin";
@@ -1643,26 +1643,13 @@ var userLevel_default$1 = "Same meaning as `level` in `InboundConfigurationObjec
1643
1643
  var userEmail_default$1 = "Same meaning as `email` in `InboundConfigurationObject`.\n";
1644
1644
  //#endregion
1645
1645
  //#region src/inbounds/protocols/shadowsocks/shadowsocks.ts
1646
- const ss22Methods = z.enum([
1647
- "2022-blake3-aes-128-gcm",
1648
- "2022-blake3-aes-256-gcm",
1649
- "2022-blake3-chacha20-poly1305"
1650
- ]);
1646
+ const ss22Methods = z.literal("2022-blake3-aes-128-gcm").or(z.literal("2022-blake3-aes-256-gcm").or(z.literal("2022-blake3-chacha20-poly1305")));
1651
1647
  const ss22UserSchema = z.object({
1652
1648
  password: z.string().optional().meta({ markdownDescription: userPassword_default$1 }),
1653
1649
  level: z.number().default(0).optional().meta({ markdownDescription: userLevel_default$1 }),
1654
1650
  email: z.string().min(1).meta({ markdownDescription: userEmail_default$1 })
1655
1651
  });
1656
- const ssMethods = z.enum([
1657
- "aes-256-gcm",
1658
- "aes-128-gcm",
1659
- "chacha20-poly1305",
1660
- "chacha20-ietf-poly1305",
1661
- "xchacha20-poly1305",
1662
- "xchacha20-ietf-poly1305",
1663
- "none",
1664
- ""
1665
- ]);
1652
+ const ssMethods = z.literal("aes-256-gcm").or(z.literal("aes-128-gcm").or(z.literal("chacha20-poly1305").or(z.literal("chacha20-ietf-poly1305").or(z.literal("xchacha20-poly1305").or(z.literal("xchacha20-ietf-poly1305").or(z.literal("none").or(z.literal(""))))))));
1666
1653
  const ssUserSchema = z.object({
1667
1654
  password: z.string().optional().meta({ markdownDescription: userPassword_default$1 }),
1668
1655
  level: z.number().default(0).optional().meta({ markdownDescription: userLevel_default$1 }),
@@ -1679,14 +1666,23 @@ const ssSettingsBaseSchema = z.object({
1679
1666
  password: z.string().min(1).meta({ markdownDescription: password_default }).optional(),
1680
1667
  email: z.string().meta({ markdownDescription: email_default }).optional()
1681
1668
  });
1682
- const shadowsocksSettingsSchema = z.discriminatedUnion("method", [ssSettingsBaseSchema.extend({
1669
+ const ssUsers = z.array(ssUserSchema).optional().meta({ markdownDescription: users_default$1 });
1670
+ const ssSettings = ssSettingsBaseSchema.extend({
1671
+ method: ssMethods.meta({ markdownDescription: method_default }),
1672
+ users: ssUsers,
1673
+ clients: ssUsers
1674
+ });
1675
+ const ss22Users = z.array(ss22UserSchema).optional().meta({ markdownDescription: users_default$1 });
1676
+ const ss22Settings = ssSettingsBaseSchema.extend({
1683
1677
  method: ss22Methods.meta({ markdownDescription: method_default }),
1684
1678
  password: z.string().min(1).meta({ markdownDescription: password_default }),
1685
- users: z.array(ss22UserSchema).optional().meta({ markdownDescription: users_default$1 })
1686
- }), ssSettingsBaseSchema.extend({
1687
- method: ssMethods.meta({ markdownDescription: method_default }),
1688
- users: z.array(ssUserSchema).optional().meta({ markdownDescription: users_default$1 })
1689
- })]).meta({ markdownDescription: shadowsocksSettings_default });
1679
+ users: ss22Users,
1680
+ clients: ss22Users
1681
+ });
1682
+ const shadowsocksSettingsSchema = z.discriminatedUnion("method", [ss22Settings, ssSettings]).meta({
1683
+ ifThenLogic: true,
1684
+ markdownDescription: shadowsocksSettings_default
1685
+ });
1690
1686
  const shadowsocksInboundSchema = generalInboundSchema.extend({
1691
1687
  protocol: z.literal("shadowsocks"),
1692
1688
  settings: shadowsocksSettingsSchema
@@ -2260,26 +2256,65 @@ const trojan = outboundSchemaBase.extend({
2260
2256
  settings: trojanServerSettings.or(z.object({ servers: z.array(trojanServerSettings).meta({ markdownDescription: trojanServers_default }) })).meta({ markdownDescription: trojanSettings_default })
2261
2257
  }).meta({ markdownDescription: trojan_default });
2262
2258
  //#endregion
2259
+ //#region src/outbounds/vless/vless.md?raw
2260
+ var vless_default = "VLESS is a stateless lightweight transport protocol. It consists of inbound and outbound parts and can serve as a bridge between the Xray client and server.\n\nUnlike [VMess](https://xtls.github.io/en/config/outbounds/vmess.html), VLESS does not depend on system time. The authentication method is also UUID.\n\n[Documentation ↗](https://xtls.github.io/en/config/outbounds/vless.html)\n";
2261
+ //#endregion
2262
+ //#region src/outbounds/vless/vlessSettings.md?raw
2263
+ var vlessSettings_default = "`OutboundConfigurationObject` corresponds to the `settings` item in [`OutboundObject`](https://xtls.github.io/en/config/outbound.html).\n";
2264
+ //#endregion
2265
+ //#region src/outbounds/vless/vlessAddress.md?raw
2266
+ var vlessAddress_default = "Server address, points to the server. Supports domain names, IPv4, and IPv6.\n";
2267
+ //#endregion
2268
+ //#region src/outbounds/vless/vlessPort.md?raw
2269
+ var vlessPort_default = "Server port, usually the same as the port the server is listening on.\n";
2270
+ //#endregion
2271
+ //#region src/outbounds/vless/vlessId.md?raw
2272
+ var vlessId_default = "User ID for VLESS. It can be any string less than 30 bytes, or a valid UUID. A custom string and its mapped UUID are equivalent.\n\nThe mapping standard is described in [VLESS UUID Mapping Standard: Mapping Custom Strings to UUIDv5](https://github.com/XTLS/Xray-core/issues/158).\n\nYou can use the command `xray uuid -i \"custom string\"` to generate the UUID mapped from a custom string, or use the command `xray uuid` to generate a random UUID.\n";
2273
+ //#endregion
2274
+ //#region src/outbounds/vless/vlessEncryption.md?raw
2275
+ var vlessEncryption_default = "[VLESS Encryption](https://github.com/XTLS/Xray-core/pull/5067) settings. Cannot be left empty; to disable, explicitly set to `\"none\"`.\n\nIt is recommended for most users to use the `xray vlessenc` command to automatically generate this field to avoid configuration mistakes. The detailed configuration below is recommended only for advanced users.\n\nIts format is a detailed configuration string of fields connected by `.`. For example: `mlkem768x25519plus.native.0rtt.100-111-1111.75-0-111.50-0-3333.ptjHQxBQxTJ9MWr2cd5qWIflBSACHOevTauCQwa_71U`. This document will refer to the separate parts separated by dots as \"blocks\".\n\n- **The 1st block** is the handshake method. Currently, there is only `mlkem768x25519plus`. Requires consistency between server and client.\n- **The 2nd block** is the encryption method. Options are `native`/`xorpub`/`random`, corresponding to: raw format packet / raw format + obfuscated public key part / fully random numbers (similar to VMESS/Shadowsocks). Requires consistency between server and client.\n- **The 3rd block** is session resumption. Choosing `0rtt` will follow the server settings to attempt to use previously generated tickets to skip the handshake for fast connection (can be manually disabled by the server). Choosing `1rtt` will force a 1-RTT handshake process. The meaning here differs from the server setting; see VLESS Inbound `decryption` settings for details.\n\nFollowing blocks are **padding**. After the connection is established, the client sends some garbage data to obfuscate length characteristics. It does not need to be the same as the server (the corresponding part in the inbound is the padding sent from the server to the client). It is a variable-length part with the format `padding.delay.padding` + `(.delay.padding)` x n (multiple padding blocks can be inserted, requiring a delay block between two padding blocks).\n\n- `padding` format is `probability-min-max`. E.g., `100-111-1111` means 100% probability to send a padding of length 111~1111.\n- `delay` format is also `probability-min-max`. E.g., `75-0-111` means 75% probability to wait 0~111 milliseconds.\n\nThe first padding block has special requirements: probability must be 100% and minimum length greater than 0. If no padding exists, the core automatically uses `100-111-1111.75-0-111.50-0-3333` as the padding setting.\n\n**The last block** will be recognized by the core as the parameter used to authenticate the server. It can be generated by `./xray x25519` (using the Password part) or `./xray mlkem768` (using the Client part). It must correspond to the server. `mlkem768` belongs to post-quantum algorithms, preventing (future) client parameter leaks from allowing quantum computers to crack the private key and impersonate the server. This parameter is only used for verification; the handshake process is post-quantum secure regardless, and existing encrypted data cannot be decrypted by future quantum computers.\n";
2276
+ //#endregion
2277
+ //#region src/outbounds/vless/vlessFlow.md?raw
2278
+ var vlessFlow_default = "Flow control mode, used to select the XTLS algorithm.\n\nCurrently, the following flow control modes are available in the outbound protocol:\n\n- **No `flow` or empty string**: Use standard TLS proxy.\n- **`xtls-rprx-vision`**: Use XTLS, including inner handshake random padding. Will intercept UDP traffic targeting port 443 (QUIC) to force browsers to use standard HTTPS, increasing traffic that can be Spliced.\n- **`xtls-rprx-vision-udp443`**: Same as `xtls-rprx-vision`, but does not intercept UDP 443. Used when a program forces the use of QUIC and would fail to work if intercepted.\n\nXTLS is available only in the following combinations:\n\n- **TCP+TLS/REALITY**: In this case, if transmitting TLS 1.3, the core will attempt to Splice encrypted data at the bottom layer. If successful, it saves all core IO overhead.\n- **VLESS Encryption**: No underlying transport restrictions. If the underlying transport is not TCP, it only attempts to penetrate Encryption, saving Encryption overhead. If it is TCP, it will still attempt to perform Splice.\n\n### TIP\n\nSplice is a function provided by the Linux Kernel. The system kernel forwards TCP directly, no longer passing through Xray's memory, greatly reducing data copying and CPU context switching.\n\nWhen using Vision mode, Splice is automatically enabled if the following conditions are met:\n\n- Linux environment.\n- Inbound protocol is a pure TCP connection like `Dokodemo door`, `Socks`, `HTTP`, or other inbound protocols using XTLS.\n- Outbound protocol is VLESS + XTLS.\n\nWhen using Splice, the network speed display will lag and will only be counted after the connection is disconnected because the core cannot know the traffic situation while the kernel takes over the connection.\n";
2279
+ //#endregion
2280
+ //#region src/outbounds/vless/vlessLevel.md?raw
2281
+ var vlessLevel_default = "User level. The connection will use the [Local Policy](https://xtls.github.io/en/config/policy.html#levelpolicyobject) corresponding to this user level.\n\nThe value of `level` corresponds to the value of `level` in [policy](https://xtls.github.io/en/config/policy.html#policyobject). If not specified, it defaults to 0.\n";
2282
+ //#endregion
2263
2283
  //#region src/outbounds/vless/vless.ts
2264
- const vless = outboundSchemaBase.extend({
2265
- protocol: z.literal("vless"),
2266
- settings: z.object({
2267
- address: z.string().meta({ markdownDescription: "Server address, points to the server. Supports domain names, IPv4, and IPv6.\n" }),
2268
- port: portLikeSchema.meta({ markdownDescription: "Server port, usually the same as the port the server is listening on.\n" }),
2269
- id: z.string().meta({ markdownDescription: "User ID for VLESS. It can be any string less than 30 bytes, or a valid UUID. A custom string and its mapped UUID are equivalent.\n\nThe mapping standard is described in [VLESS UUID Mapping Standard: Mapping Custom Strings to UUIDv5](https://github.com/XTLS/Xray-core/issues/158).\n\nYou can use the command `xray uuid -i \"custom string\"` to generate the UUID mapped from a custom string, or use the command `xray uuid` to generate a random UUID.\n" }),
2270
- encryption: z.string().default("none").meta({ markdownDescription: "[VLESS Encryption](https://github.com/XTLS/Xray-core/pull/5067) settings. Cannot be left empty; to disable, explicitly set to `\"none\"`.\n\nIt is recommended for most users to use the `xray vlessenc` command to automatically generate this field to avoid configuration mistakes. The detailed configuration below is recommended only for advanced users.\n\nIts format is a detailed configuration string of fields connected by `.`. For example: `mlkem768x25519plus.native.0rtt.100-111-1111.75-0-111.50-0-3333.ptjHQxBQxTJ9MWr2cd5qWIflBSACHOevTauCQwa_71U`. This document will refer to the separate parts separated by dots as \"blocks\".\n\n- **The 1st block** is the handshake method. Currently, there is only `mlkem768x25519plus`. Requires consistency between server and client.\n- **The 2nd block** is the encryption method. Options are `native`/`xorpub`/`random`, corresponding to: raw format packet / raw format + obfuscated public key part / fully random numbers (similar to VMESS/Shadowsocks). Requires consistency between server and client.\n- **The 3rd block** is session resumption. Choosing `0rtt` will follow the server settings to attempt to use previously generated tickets to skip the handshake for fast connection (can be manually disabled by the server). Choosing `1rtt` will force a 1-RTT handshake process. The meaning here differs from the server setting; see VLESS Inbound `decryption` settings for details.\n\nFollowing blocks are **padding**. After the connection is established, the client sends some garbage data to obfuscate length characteristics. It does not need to be the same as the server (the corresponding part in the inbound is the padding sent from the server to the client). It is a variable-length part with the format `padding.delay.padding` + `(.delay.padding)` x n (multiple padding blocks can be inserted, requiring a delay block between two padding blocks).\n\n- `padding` format is `probability-min-max`. E.g., `100-111-1111` means 100% probability to send a padding of length 111~1111.\n- `delay` format is also `probability-min-max`. E.g., `75-0-111` means 75% probability to wait 0~111 milliseconds.\n\nThe first padding block has special requirements: probability must be 100% and minimum length greater than 0. If no padding exists, the core automatically uses `100-111-1111.75-0-111.50-0-3333` as the padding setting.\n\n**The last block** will be recognized by the core as the parameter used to authenticate the server. It can be generated by `./xray x25519` (using the Password part) or `./xray mlkem768` (using the Client part). It must correspond to the server. `mlkem768` belongs to post-quantum algorithms, preventing (future) client parameter leaks from allowing quantum computers to crack the private key and impersonate the server. This parameter is only used for verification; the handshake process is post-quantum secure regardless, and existing encrypted data cannot be decrypted by future quantum computers.\n" }),
2284
+ const vlessSettings = z.object({
2285
+ address: z.string().meta({ markdownDescription: vlessAddress_default }),
2286
+ port: portLikeSchema.meta({ markdownDescription: vlessPort_default }),
2287
+ id: z.string().meta({ markdownDescription: vlessId_default }),
2288
+ encryption: z.string().default("none").meta({ markdownDescription: vlessEncryption_default }),
2289
+ flow: z.enum([
2290
+ "",
2291
+ "xtls-rprx-vision",
2292
+ "xtls-rprx-vision-udp443"
2293
+ ]).optional().meta({ markdownDescription: vlessFlow_default }),
2294
+ level: z.int().default(0).optional().meta({ markdownDescription: vlessLevel_default }),
2295
+ reverse: z.object({
2296
+ tag: z.string().meta({ markdownDescription: "The inbound proxy tag for this reverse proxy. When the server dispatches a reverse proxy request, it enters the routing system from the inbound using this tag, and the routing system routes it to the outbound you need.\n" }),
2297
+ sniffing: sniffingSchema.optional()
2298
+ }).optional().meta({ markdownDescription: "VLESS minimalist reverse proxy configuration. It preserves the real source IP information from the public-facing side.\n\nThe existence of this item indicates that this outbound can be used as a VLESS reverse proxy outbound, and it will automatically establish a connection to the server to register the reverse proxy tunnel.\n\n`tag` is the inbound proxy tag for this reverse proxy. When the server dispatches a reverse proxy request, it enters the routing system from the inbound using this tag, and the routing system routes it to the outbound you need.\n\nThe UUID used must be one that is also configured with `reverse` on the server side (see VLESS Inbound for details).\n\n`sniffing` see [SniffingObject](https://xtls.github.io/en/config/inbound.html#sniffingobject), performs sniffing on requests entering through this reverse proxy.\n\n### TIP\n\nFull tutorial: [VLESS Reverse Proxy Examples](https://xtls.github.io/en/document/level-2/vless_reverse.html)\n" })
2299
+ }).meta({ markdownDescription: vlessSettings_default });
2300
+ const vnext = z.object({ vnext: z.array(z.object({
2301
+ address: z.string().meta({ markdownDescription: vlessAddress_default }),
2302
+ port: portLikeSchema.meta({ markdownDescription: vlessPort_default }),
2303
+ users: z.array(z.object({
2304
+ id: z.string().meta({ markdownDescription: vlessId_default }),
2305
+ encryption: z.string().default("none").meta({ markdownDescription: vlessEncryption_default }),
2271
2306
  flow: z.enum([
2272
2307
  "",
2273
2308
  "xtls-rprx-vision",
2274
2309
  "xtls-rprx-vision-udp443"
2275
- ]).optional().meta({ markdownDescription: "Flow control mode, used to select the XTLS algorithm.\n\nCurrently, the following flow control modes are available in the outbound protocol:\n\n- **No `flow` or empty string**: Use standard TLS proxy.\n- **`xtls-rprx-vision`**: Use XTLS, including inner handshake random padding. Will intercept UDP traffic targeting port 443 (QUIC) to force browsers to use standard HTTPS, increasing traffic that can be Spliced.\n- **`xtls-rprx-vision-udp443`**: Same as `xtls-rprx-vision`, but does not intercept UDP 443. Used when a program forces the use of QUIC and would fail to work if intercepted.\n\nXTLS is available only in the following combinations:\n\n- **TCP+TLS/REALITY**: In this case, if transmitting TLS 1.3, the core will attempt to Splice encrypted data at the bottom layer. If successful, it saves all core IO overhead.\n- **VLESS Encryption**: No underlying transport restrictions. If the underlying transport is not TCP, it only attempts to penetrate Encryption, saving Encryption overhead. If it is TCP, it will still attempt to perform Splice.\n\n### TIP\n\nSplice is a function provided by the Linux Kernel. The system kernel forwards TCP directly, no longer passing through Xray's memory, greatly reducing data copying and CPU context switching.\n\nWhen using Vision mode, Splice is automatically enabled if the following conditions are met:\n\n- Linux environment.\n- Inbound protocol is a pure TCP connection like `Dokodemo door`, `Socks`, `HTTP`, or other inbound protocols using XTLS.\n- Outbound protocol is VLESS + XTLS.\n\nWhen using Splice, the network speed display will lag and will only be counted after the connection is disconnected because the core cannot know the traffic situation while the kernel takes over the connection.\n" }),
2276
- level: z.int().default(0).optional().meta({ markdownDescription: "User level. The connection will use the [Local Policy](https://xtls.github.io/en/config/policy.html#levelpolicyobject) corresponding to this user level.\n\nThe value of `level` corresponds to the value of `level` in [policy](https://xtls.github.io/en/config/policy.html#policyobject). If not specified, it defaults to 0.\n" }),
2277
- reverse: z.object({
2278
- tag: z.string().meta({ markdownDescription: "The inbound proxy tag for this reverse proxy. When the server dispatches a reverse proxy request, it enters the routing system from the inbound using this tag, and the routing system routes it to the outbound you need.\n" }),
2279
- sniffing: sniffingSchema.optional()
2280
- }).optional().meta({ markdownDescription: "VLESS minimalist reverse proxy configuration. It preserves the real source IP information from the public-facing side.\n\nThe existence of this item indicates that this outbound can be used as a VLESS reverse proxy outbound, and it will automatically establish a connection to the server to register the reverse proxy tunnel.\n\n`tag` is the inbound proxy tag for this reverse proxy. When the server dispatches a reverse proxy request, it enters the routing system from the inbound using this tag, and the routing system routes it to the outbound you need.\n\nThe UUID used must be one that is also configured with `reverse` on the server side (see VLESS Inbound for details).\n\n`sniffing` see [SniffingObject](https://xtls.github.io/en/config/inbound.html#sniffingobject), performs sniffing on requests entering through this reverse proxy.\n\n### TIP\n\nFull tutorial: [VLESS Reverse Proxy Examples](https://xtls.github.io/en/document/level-2/vless_reverse.html)\n" })
2281
- }).meta({ markdownDescription: "`OutboundConfigurationObject` corresponds to the `settings` item in [`OutboundObject`](https://xtls.github.io/en/config/outbound.html).\n" })
2282
- }).meta({ markdownDescription: "VLESS is a stateless lightweight transport protocol. It consists of inbound and outbound parts and can serve as a bridge between the Xray client and server.\n\nUnlike [VMess](https://xtls.github.io/en/config/outbounds/vmess.html), VLESS does not depend on system time. The authentication method is also UUID.\n\n[Documentation ↗](https://xtls.github.io/en/config/outbounds/vless.html)\n" });
2310
+ ]).optional().meta({ markdownDescription: vlessFlow_default }),
2311
+ level: z.int().default(0).optional().meta({ markdownDescription: vlessLevel_default })
2312
+ }))
2313
+ })) });
2314
+ const vless = outboundSchemaBase.extend({
2315
+ protocol: z.literal("vless"),
2316
+ settings: vlessSettings.or(vnext).meta({ markdownDescription: vlessSettings_default })
2317
+ }).meta({ markdownDescription: vless_default });
2283
2318
  //#endregion
2284
2319
  //#region src/outbounds/vmess/vmess.ts
2285
2320
  const vmess = outboundSchemaBase.extend({