Fastify plugin for determining the address of a proxied request.
Fastify use @fastify/proxy-addr by default. It can only parse X-Forwarded-For.
npm install @jafps/plugin-ip
import ipPlugin from "@jafps/plugin-ip";
const app = await fastify({ trustProxy: true })
await app.register(plugin, {
headers: [
"true-client-ip", // Akamai and Cloudflare
"x-real-ip" // Nginx
]
});