MCPcopy
hub / github.com/tinyhttp/tinyhttp / getIPs

Function getIPs

packages/app/src/request.ts:61–62  ·  view source on GitHub ↗
(req: Pick<IncomingMessage, 'headers' | 'connection'>)

Source from the content-addressed store, hash-verified

59 proxyAddr(req, trustRemoteAddress(req)).replace(/^.*:/, '') // striping the redundant prefix addeded by OS to IPv4 address
60
61export const getIPs = (req: Pick<IncomingMessage, 'headers' | 'connection'>): string[] | undefined =>
62 all(req, trustRemoteAddress(req))
63
64export const getSubdomains = (req: Request, subdomainOffset = 2): string[] => {
65 const hostname = getHostname(req)

Callers 1

extendMiddlewareFunction · 0.90

Calls 2

allFunction · 0.90
trustRemoteAddressFunction · 0.85

Tested by

no test coverage detected