Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

ip

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}`); }