Skip to content

Instantly share code, notes, and snippets.

@rmoriz
Created February 22, 2011 22:21
Show Gist options
  • Select an option

  • Save rmoriz/839550 to your computer and use it in GitHub Desktop.

Select an option

Save rmoriz/839550 to your computer and use it in GitHub Desktop.
proxy.rb
#!/usr/bin/env ruby
# run a local http proxy
require 'rubygems'
require 'webrick'
require 'webrick/httpproxy'
p = WEBrick::HTTPProxyServer.new :Port => ARGV.first
trap("INT") { p.shutdown }
p.start
# tunnel server port to localhost
ssh -R 8080:localhost:8080 root@remote.example.com
export HTTP_PROXY="http://localhost:8080/"
export HTTPS_PROXY="http://localhost:8080/"
curl https://github.com/
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment