Skip to main content
Module

x/opineHttpProxy/mod.ts>proxy

Proxy middleware for Deno Opine HTTP servers.
Latest
function proxy
import { proxy } from "https://deno.land/x/opineHttpProxy@3.2.0/mod.ts";

Takes a url argument that can be a string, URL or a function that returns one of the previous to proxy requests to. The remaining path from a request that has not been matched by Opine will be appended to the provided url when making the proxy request.

Also accepts optional options configuration allowing the user to modified all aspects of proxied request via option properties or a series of hooks allowing decoration of the outbound request and the inbound response objects.

Requests and responses can also be filtered via the filterReq and filterRes function options, allowing requests to bypass the proxy. Internally this is achieved by calling the Opine next() method to delegate to the next Opine middleware.

Parameters

url: string | URL | ProxyUrlFunction
optional
options: ProxyOptions = [UNSUPPORTED]