flow.ts 557 B

12345678910111213141516
  1. import { z } from 'zod';
  2. export const FlowSchema = z.enum([
  3. '',
  4. 'xtls-rprx-vision',
  5. 'xtls-rprx-vision-udp443',
  6. ]);
  7. export type Flow = z.infer<typeof FlowSchema>;
  8. // Const map matching the legacy models/inbound.ts `TLS_FLOW_CONTROL`
  9. // export. The empty-string default isn't keyed here — the legacy never
  10. // carried a NONE key and call sites compare against the two real flows.
  11. export const TLS_FLOW_CONTROL = Object.freeze({
  12. VISION: 'xtls-rprx-vision',
  13. VISION_UDP443: 'xtls-rprx-vision-udp443',
  14. }) satisfies Record<string, Exclude<Flow, ''>>;