A helper function to read a visitor's IP address from x-forwarded-for headers.
import { getIp } from "https://esm.town/v/mattrossman/ip/main.ts";
export default async function (req: Request) {
const ip = await getIp(req);
return new Response(`Your IP address is ${ip}`);
}