forwarded

GitHub release (latest by date)

Deno port of forwarded library.

Usage

import { serve } from 'https://deno.land/std@0.88.0/http/server.ts'
import { forwarded, parse } from 'https://deno.land/x/forwarded@v0.0.1/mod.ts'

const s = await serve({ port: 3000 })

for await (const req of s) {
  console.log(forwarded(s))
}

API

forwarded(req)

Get all addresses in the request, using the X-Forwarded-For header.

parse(header)

Parse the X-Forwarded-For header.