Sha256: e3b6ed952237a8efe4d076ff5cd1978325dec44b867b469adbd555ead872835b

Contents?: true

Size: 580 Bytes

Versions: 2

Compression:

Stored size: 580 Bytes

Contents

require 'rubygems'
require 'ZMachine'
require '../lib/z-http'

ZMachine.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 = ZMachine::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
    ZMachine.stop
  }

  http.errback {
    puts "Error: " + http.error
    puts http.inspect
    ZMachine.stop
  }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
z-http-request-0.2.0 examples/socks5.rb
z-http-request-0.1.0 examples/socks5.rb