| Title: | Reverse Proxy and Load Balancing for 'fiery' |
|---|---|
| Description: | Provides plugins for setting up 'fiery' apps as a reverse proxy. This allows you to use a 'fiery' server as a front for multiple services or even work as a load-balancer. |
| Authors: | Thomas Lin Pedersen [aut, cre] (ORCID: <https://orcid.org/0000-0002-5147-4711>), Posit Software, PBC [cph, fnd] (ROR: <https://ror.org/03wc8by49>) |
| Maintainer: | Thomas Lin Pedersen <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0.9000 |
| Built: | 2026-06-05 10:52:53 UTC |
| Source: | https://github.com/thomasp85/firestorm |
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) }# 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) }