How do get the IP address of the client in the request middleware?
KingJammin opened this issue · comments
Ben Pelo commented
Perceived Problem
Unable to get the client IP address in the middleware function.
const paramsLocale = (await getParamsLocaleCookie()) as string
const userLocale = (await getUserLocaleCookie()) as string
const language = paramsLocale || userLocale
console.log('REQUEST MIDDLEWARE', request)
return {
...request,
headers: {
...request.headers,
'X-Client-Platform': 'web',
'X-Client-Version': packageJson.version || 'default-version',
channelID,
...(language ? { language } : {})
}
}
}
Does anyone know how to get the IP address of the client from within the middleware?