resolveHttpServer() — vite Function Reference
Architecture documentation for the resolveHttpServer() function in http.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD e66d0fef_de7e_a1f4_2eb6_054a37395337["resolveHttpServer()"] 695bc011_d16d_4322_2fef_1a59a092ee32["http.ts"] e66d0fef_de7e_a1f4_2eb6_054a37395337 -->|defined in| 695bc011_d16d_4322_2fef_1a59a092ee32 5c50110b_5c76_c14f_b1dd_3efd3df7f375["preview()"] 5c50110b_5c76_c14f_b1dd_3efd3df7f375 -->|calls| e66d0fef_de7e_a1f4_2eb6_054a37395337 24ecf2a1_3c09_d451_76f3_9485b4e993f8["_createServer()"] 24ecf2a1_3c09_d451_76f3_9485b4e993f8 -->|calls| e66d0fef_de7e_a1f4_2eb6_054a37395337 19009191_26ac_2526_d048_41ac02638e55["createServer()"] e66d0fef_de7e_a1f4_2eb6_054a37395337 -->|calls| 19009191_26ac_2526_d048_41ac02638e55 style e66d0fef_de7e_a1f4_2eb6_054a37395337 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/vite/src/node/http.ts lines 119–144
export async function resolveHttpServer(
app: Connect.Server,
httpsOptions?: HttpsServerOptions,
): Promise<HttpServer> {
if (!httpsOptions) {
const { createServer } = await import('node:http')
return createServer(app)
}
const { createSecureServer } = await import('node:http2')
return createSecureServer(
{
// Manually increase the session memory to prevent 502 ENHANCE_YOUR_CALM
// errors on large numbers of requests
maxSessionMemory: 1000,
// Increase the stream reset rate limit to prevent net::ERR_HTTP2_PROTOCOL_ERROR
// errors on large numbers of requests
streamResetBurst: 100000,
streamResetRate: 33,
...httpsOptions,
allowHTTP1: true,
},
// @ts-expect-error TODO: is this correct?
app,
)
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does resolveHttpServer() do?
resolveHttpServer() is a function in the vite codebase, defined in packages/vite/src/node/http.ts.
Where is resolveHttpServer() defined?
resolveHttpServer() is defined in packages/vite/src/node/http.ts at line 119.
What does resolveHttpServer() call?
resolveHttpServer() calls 1 function(s): createServer.
What calls resolveHttpServer()?
resolveHttpServer() is called by 2 function(s): _createServer, preview.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free