Rack::Proxy
Added by cwninja
at October 11, 2009 22:52
GitHub stats:
watcher(s)
fork(s)
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"]] }
