Skip to main content
Version: v0.x

How is ProxiedRequest constructed?

How Proxyflare proxies requests

When Proxyflare runs a Route, it constructs the ProxiedRequest based on three parameters:

  1. Request["url"]
  2. Route["from.pattern"]
  3. Route["to.url"]

The general formula is:

ProxiedRequest["href"] =
Route["to.url"].origin +
(Request["url.pathname"] +
(Route["to.url"].pathname - Route["from.pattern"].pathname))

Setting stripFromPath to modify ProxiedRequest

Depending on your requirements, you might want to include the pathname of Route["from.pattern"] in the ProxiedRequest. To do this, set stripFromPath: false on your Route.

const routes: Route[] = [
from: { pattern: "*", stripFromPath: false },

The table below demonstrates how stripFromPath: false modifies a ProxiedRequest.


Set the Configuration["global.debug"] flag to attach a x-proxyflare-proxied-pathname response header to matched requests. This debug header contains the matched pathname.