Sha256: 21dd95d03f03cde8fa01e5ca31cd566cd08ffd3c7368a4b3fb1dc14943322553

Contents?: true

Size: 580 Bytes

Versions: 3

Compression:

Stored size: 580 Bytes

Contents

require 'helper'

requires_connection do

  describe EventMachine::HttpRequest do

    # ssh -D 8080 igvita
    let(:proxy) { {:proxy => { :host => '127.0.0.1', :port => 8080, :type => :socks5 }} }

    it "should use SOCKS5 proxy" do
      EventMachine.run {
        http = EventMachine::HttpRequest.new('http://whatismyip.everdot.org/', proxy).get

        http.errback { failed(http) }
        http.callback {
          http.response_header.status.should == 200
          http.response.should match('72.52.131')
          EventMachine.stop
        }
      }
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
em-http-request-1.0.0.beta.3 spec/socksify_proxy_spec.rb
em-http-request-1.0.0.beta.2 spec/socksify_proxy_spec.rb
em-http-request-1.0.0.beta.1 spec/socksify_proxy_spec.rb