Optional
followWhen is set to true, the proxy method will follow redirects and return the final response. All redirect locations which are absolute URLs need to be setup in hostnames section of the edgio.config.js and have configured origin otherwise the default origin will be used. Due to security policy is not possible to share cookie and authorization headers between different hostnames.
false
Optional
headersAdditional headers to send upstream
Optional
pathThe path for the URL to request from the upstream site. You can reference variables
captured by the route pattern using :variable
.
Example
new Router()
.get('/some/path/with/:variable', ({ proxy }) => {
proxy('legacy', { path: '/some/other/path/with/:variable' })
})
Path can also be a function that returns a URL path string, in which case it will be computed in the cloud rather than at build time.
Optional
removeRemoves the "=" from search parameters that have no value. So for example: "http://domain.com?foo=&bar=" becomes "http://domain.com?foo&bar"
Optional
transformA function that transforms the request before it is sent to the origin server. In general, this is used to alter the request headers or body based on some conditional logic. Note that code in this method will be executed using Edgio Cloud Functions and not at the edge.
Optional
transformA function that transforms the response before it is returned to the browser. This function
typically alters response.body
to change the content sent to the browser. It can also add, remove,
and alter response headers.
Note that code in this method will be executed using Edgio Cloud Functions and not at the edge.
Generated using TypeDoc
Options for the
proxy
method