Sha256: f0da6d2b23edcc50fe3b2e3d3b42bf45005f8ff76ee12c671c3a766bfb925198

Contents?: true

Size: 561 Bytes

Versions: 17

Compression:

Stored size: 561 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

  connection_options = {:proxy => {:host => '127.0.0.1', :port => 8000, :type => :socks5}}
  http = EM::HttpRequest.new('http://igvita.com/', connection_options).get :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

17 entries across 17 versions & 2 rubygems

Version Path
em-http-request-samesite-0.1.1 examples/socks5.rb
em-http-request-samesite-1.1.7 examples/socks5.rb
em-http-request-1.1.7 examples/socks5.rb
em-http-request-1.1.6 examples/socks5.rb
em-http-request-1.1.5 examples/socks5.rb
em-http-request-1.1.4 examples/socks5.rb
em-http-request-1.1.3 examples/socks5.rb
em-http-request-1.1.2 examples/socks5.rb
em-http-request-1.1.1 examples/socks5.rb
em-http-request-1.1.0 examples/socks5.rb
em-http-request-1.0.3 examples/socks5.rb
em-http-request-1.0.2 examples/socks5.rb
em-http-request-1.0.1 examples/socks5.rb
em-http-request-1.0.0 examples/socks5.rb
em-http-request-1.0.0.beta.4 examples/socks5.rb
em-http-request-1.0.0.beta.3 examples/socks5.rb
em-http-request-1.0.0.beta.2 examples/socks5.rb