Sha256: 32f526cc3650f30b1d01af239725e8a8c6ed43cc4cb598c67010fa8e104073e8
Contents?: true
Size: 594 Bytes
Versions: 5
Compression:
Stored size: 594 Bytes
Contents
require 'rubygems' require 'eventmachine' require '../lib/em-http' EM.run do # Establish a SOCKS5 tunnel via SSH # ssh -D 8000 some_remote_machine # http = EM::HttpRequest.new('http://whatismyip.org/').get({ http = EM::HttpRequest.new('http://igvita.com/').get({ :proxy => {:host => '127.0.0.1', :port => 8000, :type => :socks}, :redirects => 2 }) http.callback { puts "#{http.response_header.status} - #{http.response.length} bytes\n" puts http.response EM.stop } http.errback { puts "Error: " + http.error puts http.inspect EM.stop } end
Version data entries
5 entries across 5 versions & 1 rubygems