tun.ts 689 B

123456789101112131415
  1. import { z } from 'zod';
  2. export const TunInboundSettingsSchema = z.object({
  3. name: z.string().default('xray0'),
  4. mtu: z.number().int().min(0).default(1500),
  5. gateway: z.array(z.string()).default([]),
  6. dns: z.array(z.string()).default([]),
  7. userLevel: z.number().int().min(0).default(0),
  8. autoSystemRoutingTable: z.array(z.string()).default([]),
  9. autoOutboundsInterface: z.string().default('auto'),
  10. // xray-core 26.9.30: the first acts on Linux, the second ("dns", "misconfigtun") on Windows.
  11. autoSystemDnsToGateway: z.boolean().optional(),
  12. autoSystemWfpBlockLeak: z.array(z.string()).optional(),
  13. });
  14. export type TunInboundSettings = z.infer<typeof TunInboundSettingsSchema>;