Skip to content

Instantly share code, notes, and snippets.

@kyledrake
Created October 14, 2015 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyledrake/6fd809c41cc52d1828a5 to your computer and use it in GitHub Desktop.
Save kyledrake/6fd809c41cc52d1828a5 to your computer and use it in GitHub Desktop.
Puma "reverse proxy" debugging wackiness
# 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