httpupgrade.ts 581 B

1234567891011121314
  1. import { z } from 'zod';
  2. import { WsHeaderMapSchema } from '@/schemas/protocols/stream/ws';
  3. // HTTP Upgrade transport reuses the flat WS-style header map (string values,
  4. // not arrays — toV2Headers with arr=false). No heartbeat field — that's
  5. // websocket-specific.
  6. export const HttpUpgradeStreamSettingsSchema = z.object({
  7. acceptProxyProtocol: z.boolean().default(false),
  8. path: z.string().default('/'),
  9. host: z.string().default(''),
  10. headers: WsHeaderMapSchema.default({}),
  11. });
  12. export type HttpUpgradeStreamSettings = z.infer<typeof HttpUpgradeStreamSettingsSchema>;