blackhole.ts 674 B

12345678910111213
  1. import { z } from 'zod';
  2. export const BlackholeResponseTypeSchema = z.enum(['none', 'http']);
  3. export type BlackholeResponseType = z.infer<typeof BlackholeResponseTypeSchema>;
  4. // Blackhole drops traffic. `response.type` is the only knob — when set, Xray
  5. // returns the canned 403 HTTP response before closing; when omitted it
  6. // silently drops. The panel stores it as { response: { type } } or omits the
  7. // whole `response` key when type is empty.
  8. export const BlackholeOutboundSettingsSchema = z.object({
  9. response: z.object({ type: BlackholeResponseTypeSchema }).optional(),
  10. });
  11. export type BlackholeOutboundSettings = z.infer<typeof BlackholeOutboundSettingsSchema>;