Home / Type/ ProxyOptions Type — vite Architecture

ProxyOptions Type — vite Architecture

Architecture documentation for the ProxyOptions type/interface in proxy.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  05b97f5d_3ed3_9bce_0c0f_62f0d2fcd320["ProxyOptions"]
  d873c697_620e_ffca_0134_e9fecd784782["proxy.ts"]
  05b97f5d_3ed3_9bce_0c0f_62f0d2fcd320 -->|defined in| d873c697_620e_ffca_0134_e9fecd784782
  style 05b97f5d_3ed3_9bce_0c0f_62f0d2fcd320 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/server/middlewares/proxy.ts lines 11–41

export interface ProxyOptions extends httpProxy.ServerOptions {
  /**
   * rewrite path
   */
  rewrite?: (path: string) => string
  /**
   * configure the proxy server (e.g. listen to events)
   */
  configure?: (proxy: httpProxy.ProxyServer, options: ProxyOptions) => void
  /**
   * webpack-dev-server style bypass function
   */
  bypass?: (
    req: http.IncomingMessage,
    /** undefined for WebSocket upgrade requests */
    res: http.ServerResponse | undefined,
    options: ProxyOptions,
  ) =>
    | void
    | null
    | undefined
    | false
    | string
    | Promise<void | null | undefined | boolean | string>
  /**
   * rewrite the Origin header of a WebSocket request to match the target
   *
   * **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
   */
  rewriteWsOrigin?: boolean | undefined
}

Frequently Asked Questions

What is the ProxyOptions type?
ProxyOptions is a type/interface in the vite codebase, defined in packages/vite/src/node/server/middlewares/proxy.ts.
Where is ProxyOptions defined?
ProxyOptions is defined in packages/vite/src/node/server/middlewares/proxy.ts at line 11.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free