Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Multiplex multiple rack servers to the same rack app
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/rack
spec
Gemfile
README.md
rack-mux.gemspec

README.md

rack-mux

Multiplex multiple rack servers to the same app.

example

config.ru

require 'rack/mux'

use Rack::Mux
run lambda {|env| [200, {'Content-Type' => 'text/plain'}, [env['X-Mux-Uri']]] }

rackup

% rackup config.ru -p 9292

irb

>> require 'rack/client'
=> true
>> uri = Rack::Client.new("http://localhost:9292/").get("/").body
=> 'http://0.0.0.0:4000'
>> Rack::Client.new(uri).get('/').status
=> 200
Something went wrong with that request. Please try again.