Created
September 27, 2012 12:24
-
-
Save MichalPekala/3793722 to your computer and use it in GitHub Desktop.
Revisions
-
MichalPekala revised this gist
Sep 27, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ require 'rubygems' require 'rack/streaming_proxy' use Rack::Auth::Basic, "Restricted Area" do |username, password| [username, password] == ['user', 'password'] -
MichalPekala created this gist
Sep 27, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ require 'rubygems' require "rack/streaming_proxy" use Rack::Auth::Basic, "Restricted Area" do |username, password| [username, password] == ['user', 'password'] end use Rack::StreamingProxy do |request| if request.path.start_with?("/proxy") "http://other.host#{request.path}" end end run proc{|env| [200, {"Content-Type" => "text/plain"}, ["Running..."]] }