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-1.0.1 lib/spiderfw/utils/http_client.rb
spiderfw-1.0.0 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.39 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.38 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.37 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.35 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.34 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.33 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.32 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.31 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.30 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.29 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.28 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.27 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.26 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.26.pre1 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.25 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.24 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.23 lib/spiderfw/utils/http_client.rb
spiderfw-0.6.22 lib/spiderfw/utils/http_client.rb