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

Version Path
em-http-request-1.0.0.beta.1 examples/socks5.rb
em-http-request-0.3.0 examples/socks5.rb
em-http-request-0.2.15 examples/socks5.rb
em-http-request-0.2.14 examples/socks5.rb
em-http-request-0.2.13 examples/socks5.rb