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

proxy_addr

GitHub release (latest by date) GitHub Workflow Status Codecov

Deno port of proxy-addr library.

Usage

import { serve } from 'https://deno.land/std@0.185.0/http/server.ts'
import {
  proxyaddr,
  RequestWithConnection,
} from 'https://deno.land/x/proxy_addr/mod.ts'

await serve((req, conn) => {
  const request = req as RequestWithConnection

  request.conn = conn

  const res = proxyaddr(request, ['127.0.0.1'])

  return new Response(res)
})