proxi_clean 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/proxi_clean/client.rb +5 -4
- data/lib/proxi_clean/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8ece1d7765524b7e19b4a315861ae09915e492d
|
4
|
+
data.tar.gz: 2dab5fa4caddd7f6ea76dca335a93c24e2f57876
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 [
|
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
|
|
data/lib/proxi_clean/client.rb
CHANGED
@@ -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://
|
42
|
-
req.options.timeout =
|
43
|
-
req.options.open_timeout =
|
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)['
|
46
|
+
JSON.parse(response.body)['ip']
|
46
47
|
end
|
47
48
|
end
|
48
49
|
end
|
data/lib/proxi_clean/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|