Sha256: 4c73f3a31aa2f318a795768b64015dc41c03919eeb0405c01cf5b627ec8b58c7

Contents?: true

Size: 433 Bytes

Versions: 45

Compression:

Stored size: 433 Bytes

Contents

require 'open-uri'

module Spider

    def self.http_client
        uri = URI.parse('http://www.test.com')
        proxy = uri.find_proxy
        klass = nil
        if proxy
            proxy_user, proxy_pass = nil
            proxy_user, proxy_pass = proxy.userinfo.split(/:/) if proxy.userinfo
            Net::HTTP::Proxy(proxy.host, proxy.port, proxy_user, proxy_pass)
        else
            Net::HTTP
        end
    end

end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
spiderfw-0.6.1 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.0 lib/spiderfw/utils/http_client.rb
spiderfw-0.5.19 lib/spiderfw/utils/http_client.rb
spiderfw-0.5.18 lib/spiderfw/utils/http_client.rb
spiderfw-0.5.17 lib/spiderfw/utils/http_client.rb