Home / Function/ getRequestSocket() — astro Function Reference

getRequestSocket() — astro Function Reference

Architecture documentation for the getRequestSocket() function in node.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  3c0be459_dc6c_03b0_a286_7074c61621a1["getRequestSocket()"]
  81a03fae_a2bc_f6d1_94ef_f29ffefe8af6["node.ts"]
  3c0be459_dc6c_03b0_a286_7074c61621a1 -->|defined in| 81a03fae_a2bc_f6d1_94ef_f29ffefe8af6
  859c2d6f_02be_836d_7e05_a64bead34fc2["createRequest()"]
  859c2d6f_02be_836d_7e05_a64bead34fc2 -->|calls| 3c0be459_dc6c_03b0_a286_7074c61621a1
  style 3c0be459_dc6c_03b0_a286_7074c61621a1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/app/node.ts lines 308–318

function getRequestSocket(req: NodeRequest): Socket | undefined {
	if (req.socket && typeof req.socket.on === 'function') {
		return req.socket;
	}
	const http2Socket = (req as unknown as { stream?: { session?: { socket?: Socket } } }).stream
		?.session?.socket;
	if (http2Socket && typeof http2Socket.on === 'function') {
		return http2Socket;
	}
	return undefined;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does getRequestSocket() do?
getRequestSocket() is a function in the astro codebase, defined in packages/astro/src/core/app/node.ts.
Where is getRequestSocket() defined?
getRequestSocket() is defined in packages/astro/src/core/app/node.ts at line 308.
What calls getRequestSocket()?
getRequestSocket() is called by 1 function(s): createRequest.

Analyze Your Own Codebase

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

Try Supermodel Free