Created
October 14, 2015 23:51
-
-
Save kyledrake/6fd809c41cc52d1828a5 to your computer and use it in GitHub Desktop.
Puma "reverse proxy" debugging wackiness
This file contains 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 characters
# puma -p 31337 -q | |
require 'net/http' | |
run Proc.new { |env| | |
uri = URI('http://127.0.0.1:80/') | |
response = nil | |
Net::HTTP.start(uri.host, uri.port) do |http| | |
client_req = Net::HTTP::Get.new uri | |
response = http.request(client_req).body | |
end | |
['200', {'Content-Type' => 'text/html'}, [response]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment