proxi_clean 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37b2808d78d23e3acb73baae1109f2856577cb65
4
- data.tar.gz: 34cd41a3b0bdd3245661231bcc3465860292db64
3
+ metadata.gz: c8ece1d7765524b7e19b4a315861ae09915e492d
4
+ data.tar.gz: 2dab5fa4caddd7f6ea76dca335a93c24e2f57876
5
5
  SHA512:
6
- metadata.gz: f00387a4977f012ef6649223596752cd92158ace51bfbb4b38c4dd966930c35d9b19ea4b835d3e86b0b3f4fe938f6366e221ea93cd5a890fa0b82a1ea044b227
7
- data.tar.gz: f4ecc1d355b6feb8ef7ea26588c6acdd40d9d3f060ef4e4a6189919ff545328c13595a7195fb9c2d918db9972777a0e07234e1550c04eb8236c105968939fbc2
6
+ metadata.gz: 6564117fff476e6e7b618ee2d330758baf16838d28a56cd2bcd6c2d1d8ef1075ceffe9a9f12303a81b2ea5cf85948d9f39c131b9b57671f3b03e9fe7006b2d30
7
+ data.tar.gz: 45204dc1c73751effb3d0af92b88effaef76b6f75abe402f19959c3f97a5fda3e94116892957f399a5b0e635fe7c42b144b3c659440db6afe924e25dc91f672c
data/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  A simple utility for checking if an http proxy works or not. If you deal with huge lists of proxies and need to clean out the dead or non-functional ones, this might help you.
11
11
 
12
12
  ## How does it work?
13
- Using the power of oxygen `proxi_clean` will make a call to the [realip.info](http://www.realip.info/api/p/realip.php) API using `RestClient` and determine it's unproxied public IP. When checking if a proxy is valid or not `proxi_clean` reconfigures `RestClient` to use the proxy you provide and confirms that realip returns an IP address that does NOT match your unproxied public IP.
13
+ Using the power of oxygen `proxi_clean` will make a call to the [ipinfo.io](http://ipinfo.io) API (JSON is returned with proper headers) using `Faraday` and determine the current unproxied public IP. When checking if a proxy is valid or not `proxi_clean` reconfigures itself to use the proxy you provide and confirms that `ipinfo.io` returns an IP address that does NOT match your unproxied public IP.
14
14
 
15
15
  If anything goes wrong we blindly assume the proxy is no good.
16
16
 
@@ -37,12 +37,13 @@ module ProxiClean
37
37
  def real_ip(proxy_uri: nil)
38
38
  conn = Faraday.new(proxy: proxy_uri)
39
39
  conn.headers[:user_agent] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36'
40
+ conn.headers[:accept] = 'application/json'
40
41
  response = conn.get do |req|
41
- req.url 'http://www.realip.info/api/p/realip.php'
42
- req.options.timeout = 5
43
- req.options.open_timeout = 2
42
+ req.url 'http://ipinfo.io'
43
+ req.options.timeout = 8
44
+ req.options.open_timeout = 5
44
45
  end
45
- JSON.parse(response.body)['IP']
46
+ JSON.parse(response.body)['ip']
46
47
  end
47
48
  end
48
49
  end
@@ -1,3 +1,3 @@
1
1
  module ProxiClean
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxi_clean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Zigliotto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-08 00:00:00.000000000 Z
11
+ date: 2015-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.4.6
155
+ rubygems_version: 2.4.8
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Proxi Clean will check your proxy and tell you if it's working or not.