MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / getSocketRemoteAddress

Function getSocketRemoteAddress

src/webui/middleware/auth.ts:121–125  ·  view source on GitHub ↗
(c: Context)

Source from the content-addressed store, hash-verified

119
120/** Extracts the Node socket-level remote address from the Hono context. */
121export function getSocketRemoteAddress(c: Context): string | undefined {
122 // @hono/node-server exposes the raw Node IncomingMessage as c.env.incoming
123 const env = c.env as { incoming?: { socket?: { remoteAddress?: string } } } | undefined
124 return env?.incoming?.socket?.remoteAddress
125}
126
127/**
128 * Normalize an IP literal for comparison: strip the IPv6 zone suffix

Callers 4

createAuthMiddlewareFunction · 0.85
createAuthRoutesFunction · 0.85
isTrustedProxyPeerFunction · 0.85
readClientIpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected