Skip to content

Commit 72d543e

Browse files
committed
Update README
* Update TravisCI * Add WIP-Warning
1 parent ee253bb commit 72d543e

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,47 @@
11
# A Reverse Proxy for Rack
2-
[![TravisCI](https://secure.travis-ci.org/tstmedia/rack-reverse-proxy.png "Build Status")](http://travis-ci.org/tstmedia/rack-reverse-proxy "Build Status")
2+
[![TravisCI](https://secure.travis-ci.org/pex/rack-reverse-proxy.png "Build Status")](http://travis-ci.org/pex/rack-reverse-proxy "Build Status")
33

4-
This is a simple reverse proxy for Rack that pretty heavily rips off Rack Forwarder. It is not meant for production systems (although it may work), as the webserver fronting your app is generally much better at this sort of thing.
4+
This is a simple reverse proxy for Rack that pretty heavily rips off Rack Forwarder. It is not meant for production systems (although it may work), as the webserver fronting your app is generally much better at this sort of thing.
5+
6+
## Warning
7+
8+
This is a **work in progress** and this fork (like others) breaks almost all test cases because of a [rack-proxy](https://github.com/ncr/rack-proxy) / [webmock](https://github.com/bblimke/webmock) issue described in [pex/rack-reverse-proxy#1](https://github.com/pex/rack-reverse-proxy/issues/1).
9+
Rack Proxy
10+
11+
[Rack-proxy](https://github.com/ncr/rack-proxy) was introduced in [rack-reverse-proxy c6bbe0b](https://github.com/pex/rack-reverse-proxy/commit/c6bbe0b31a090ce81053c324581e205d8b3a5485).
512

613
## Installation
714
The gem is available on gemcutter. Assuming you have a recent version of Rubygems you should just be able to install it via:
815

9-
gem install rack-reverse-proxy
16+
```
17+
gem install rack-reverse-proxy
18+
```
1019

1120
For your Gemfile use:
1221

13-
gem "rack-reverse-proxy", :require => "rack/reverse_proxy"
22+
```ruby
23+
gem "rack-reverse-proxy", require: "rack/reverse_proxy"
24+
```
1425

1526
## Usage
16-
Matchers can be a regex or a string. If a regex is used, you can use the subcaptures in your forwarding url by denoting them with a $.
27+
Matchers can be a regex or a string. If a regex is used, you can use the subcaptures in your forwarding url by denoting them with a `$`.
1728

18-
Right now if more than one matcher matches any given route, it throws an exception for an ambiguous match. This will probably change later. If no match is found, the call is forwarded to your application.
29+
Right now if more than one matcher matches any given route, it throws an exception for an ambiguous match. This will probably change later. If no match is found, the call is forwarded to your application.
1930

2031
Below is an example for configuring the middleware:
2132

2233
```ruby
2334
require 'rack/reverse_proxy'
2435

25-
use Rack::ReverseProxy do
36+
use Rack::ReverseProxy do
2637
# Set :preserve_host to true globally (default is true already)
27-
reverse_proxy_options :preserve_host => true
38+
reverse_proxy_options preserve_host: true
2839

2940
# Forward the path /test* to http://example.com/test*
3041
reverse_proxy '/test', 'http://example.com/'
3142

3243
# Forward the path /foo/* to http://example.com/bar/*
33-
reverse_proxy /^\/foo(\/.*)$/, 'http://example.com/bar$1', :username => 'name', :password => 'basic_auth_secret'
44+
reverse_proxy /^\/foo(\/.*)$/, 'http://example.com/bar$1', username: 'name', password: 'basic_auth_secret'
3445
end
3546

3647
app = proc do |env|
@@ -55,6 +66,6 @@ reverse_proxy_options sets global options for all reverse proxies. Available opt
5566
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
5667
* Send me a pull request. Bonus points for topic branches.
5768

58-
== Copyright
69+
## Copyright
5970

6071
Copyright (c) 2010 Jon Swope. See LICENSE for details.

0 commit comments

Comments
 (0)