| ReverseProxy | R Documentation |
Fiery plugin for a single reverse proxy
Fiery plugin for a single reverse proxy
This plugin establishes a reverse proxy between the server and a target origin server. It supports both HTTP and WebSocket connections and sets all the relevant headers for tracking the request along the proxy chain.
A new 'ReverseProxy'-object is initialized using the new() method on
the generator:
Usage
route <- ReverseProxy$new(target, root = "/", continue = FALSE, trust = FALSE)
|
nameThe name used by default for the plugin
new()Create a new reverse proxy
ReverseProxy$new(target, root = "/", except = NULL, trust = FALSE)
targetThe URL to the origin server being proxied
rootThe root path the reverse proxy should respond to. Only requests to subsets of the root path will be proxied, and the root will be stripped from the URL path before being forwarded
exceptSubpaths to root that should be excempt from forwarding
to the target.
trustAre requests coming from a trusted source
on_attach()Hook for attaching the plugin to a fiery app. Should not be called directly
ReverseProxy$on_attach(app, ...)
appThe fiery app to attach to
...Ignored
clone()The objects of this class are cloneable with this method.
ReverseProxy$clone(deep = FALSE)
deepWhether to make a deep clone.
# Create a reverse proxy forwarding requests to http://example.com
rev_prox <- ReverseProxy$new(
"http://example.com"
)
# Use root to only proxy requests to a specific subpath
rev_prox <- ReverseProxy$new(
"http://example.com",
root = "forward"
)
# Use except to exempt certain subpaths from proxying
rev_prox <- ReverseProxy$new(
"http://example.com",
except = c("no_proxy", "dont/proxy")
)
## Attach it to a fiery app
if (requireNamespace("fiery", quietly = TRUE)) {
app <- fiery::Fire$new()
app$attach(rev_prox)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.