No commit activity in last 3 years
No release in over 3 years
Turns Goliath into a reverse proxy server. Useful when paired with other middleware, such as authentication.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.10

Runtime

 Project Readme

goliath-reverse-proxy

Goliath reverse proxy middleware. Forwards all requests to another server.

Dependencies

All the work is done by em-http-request, em-syncrony, and goliath.

Install

gem install goliath-reverse-proxy

or add to your Gemfile

gem 'goliath-reverse-proxy'

Example

require 'goliath'
require 'goliath/rack/reverse_proxy'

class Proxy < Goliath::API
  # Include other middleware here before the proxy
  # Params is required to pass along data
  use Goliath::Rack::Params
  use Goliath::Rack::ReverseProxy, base_url: 'http://127.0.0.1:8000'

  def response(env)
    [200, {}, []]
  end
end