ProxyUtilities
Gem to get lists of Proxies and check them if they are still available.
Installation
Add this line to your application's Gemfile:
gem 'proxy_utilities'
And then execute:
$ bundle
Or install it yourself as:
$ gem install proxy_utilities
Usage
This gem has two features at the moment:
- Get a list of proxies.
- Check if a proxy is available
Getter
list = ProxyUtilities.get_proxies
#=>[{:ip => "0.0.0.0",:port => 80, :country_code => "US", :anonymity => "transparent", :type => "SOCKS5"}, {...}, ...]
Checker
This module checks if the proxy can reach a website over the proxy, also additional websites can be enabled.
checked_proxy = ProxyUtilities.check_proxy("0.0.0.0", 80)
#=> {:status => true}
# or
#=> {:status => false}
also working:
checked_proxy = ProxyUtilities.check_proxy("0.0.0.0", "80")
Following additional attributes are supported:
checked_proxy = ProxyUtilities.check_proxy("0.0.0.0", 80, check_websites: true)
#=> {:status => true, :websites => {:google => true, :amazon => true}}
checked_proxy = ProxyUtilities.check_proxy("0.0.0.0", 80, check_websites: true, webistes: ["https://github.com/ruby-matze/proxy_utilities"])
#=> {:status => true, :websites => {:google => true, :amazon => true, "https://github.com/ruby-matze/proxy_utilities" => true}
Checking full lists of proxies like:
list = [{{:ip => "0.0.0.0", :port => 80, ...}, ...]
checked_proxy = ProxyUtilities.check_proxy_list(list, check_websites: true, webistes: ["https://github.com/ruby-matze/proxy_utilities"])
#=> [{:ip => "0.0.0.0", :port => 80, :status => true, :websites => {:google => true, :amazon => true, "https://github.com/ruby-matze/proxy_utilities" => true}, ....]
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby-matze/proxy_utilities.
License
The gem is available as open source under the terms of the MIT License.