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

proxy_addr

GitHub release (latest by date)

Deno port of proxy-addr library.

Usage

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

const s = new Server({
  handler: (req, conn) => {
    const request = req as RequestWithConnection

    request.conn = conn

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

    return new Response(res)
  }
})