Skip to content

Instantly share code, notes, and snippets.

@nuke99
Created June 6, 2012 05:33
Show Gist options
  • Save nuke99/2880077 to your computer and use it in GitHub Desktop.
Save nuke99/2880077 to your computer and use it in GitHub Desktop.
require 'webrick'
require 'webrick/httpproxy'
require 'pp'
s = WEBrick::HTTPProxyServer.new(:Port => 8080,
:RequestCallback => Proc.new{|req,res|
#puts req.request_line
#puts "+--------------------------------------+"
pp req.raw_header
})
# Shutdown functionality
trap("INT"){s.shutdown}
# run the beast
s.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment