MCPcopy Create free account
hub / github.com/baiwumm/react-admin / getRealIp

Function getRealIp

Xmw_server/src/utils/index.ts:117–124  ·  view source on GitHub ↗
(req: Request)

Source from the content-addressed store, hash-verified

115 * @param {Request} req
116 */
117export const getRealIp = (req: Request): string => {
118 const result =
119 req.headers['x-forwarded-for'] ||
120 req.headers['x-real-ip'] ||
121 req.socket.remoteAddress ||
122 req.ip;
123 return Array.isArray(result) ? result[0] : result;
124};

Callers 2

loginMethod · 0.90
logActionMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected