-
-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Dupe Check
- I have searched Swetrix feature requests and there are no duplicates
Describe the solution you'd like?
Many proxies (CloudFront, Cloudflare...etc) already added headers which provide user location info and usually more accurate than lookup location via IP address. So IMO allow config to use these headers to determine user location is more efficient, and it also faster (since just need to read header). And fallback to use ip lookup if headers is omit.
Example
// Current code
const ip = getIPFromHeaders(headers) || reqIP || ''
const { country, city, region } = getGeoDetails(ip)
// New
let { ip, location } = getClientRequestInfo(headers);
if (!location) {
location = getGeoDetails(ip);
}
Additional context
No response
How important is this feature to you?
3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request