Rack::Proxy

Added by cwninja at October 11, 2009 22:52 Star_small_grayStar_small_grayStar_small_grayStar_small_grayStar_small_gray
GitHub stats:
Magnifier watcher(s)
Arrow_branch fork(s)
Wrench

About

Proxy server to route specific requests to specific remote servers.

Combine with Rack::Cache for a slow and inefficient remote caching proxy!

Useful for proxying remote webservices for XS AJAX calls.

Usage


use Rack::Proxy do |req|
  if req.path =~ %r{^/remote/service.php$}
    URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
  end
end

run proc{|env| [200, {"Content-Type" => "text/plain"}, ["Ha ha ha"]] }

blog comments powered by Disqus