Created
February 22, 2011 22:21
-
-
Save rmoriz/839550 to your computer and use it in GitHub Desktop.
proxy.rb
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 characters
| #!/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 | |
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 characters
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 characters
| # 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