Skip to main content
Deno 2 is finally here 🎉️
Learn more

forwarded

GitHub release (latest by date) GitHub Workflow Status Codecov

Deno port of forwarded library.

Usage

import { Server } from 'https://deno.land/std@0.167.0/http/server.ts'
import { forwarded, parse } from 'https://deno.land/x/forwarded/mod.ts'

const s = new Server({
  port: 8080,
  handler: (req) => {
    return new Response(JSON.stringify(forwarded(req))
  }
})

API

forwarded(req)

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

parse(header)

Parse the X-Forwarded-For header.