ip2proxy_ruby 3.3.0 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30a6be5f8b9be3046d9450d970a996f61f07d49c35dc8ad44036f534457e8cb1
4
- data.tar.gz: 7b2babc2892f5f6c29d5038ab86d23da675e7cd0acadac7bf035e2ab2f2fff39
3
+ metadata.gz: 7574dfbc7f1fd1a881fe0e05f0d041a7272fb121e9be4c307aa41c0710e92a49
4
+ data.tar.gz: 5f0cdbe708bd355ed1910e8914e150b539109a49a1ee4dd2b25d556cd6d9bd69
5
5
  SHA512:
6
- metadata.gz: 0304a809be3a8fc3e87265b2c93811a91aa6595d1ce535132db963d114a6ec4b9e2102dc2418f99d3812ada25cc18fff631065387e9b1aff3dad777ac1c598c8
7
- data.tar.gz: 6faecc7b8ca06d0b0221fa926d587d45bd9e447f881f1b0e7a84e3873adb6a7af831ba9d37fe5105f6f7e46e82113e89f968735c30d401a67dafa6fcc4c85889
6
+ metadata.gz: 050c2a2e9c42bb4b601dd8e31bc8119781d3709dbddef7e1d63ab2c3b07f4ee53bdf4a8f11dd461bec0b7f4382d5f0dbd58ac378216b4c0bdcc332a5ad096c91
7
+ data.tar.gz: d8310cc6b583300425e6ef7e89a599858a07d13166ab9783873f42bbe2fe45fc62841fa828c6a19ef8956213043f76dc6c6c51f85ace8f02ff7568067364c738
data/Gemfile CHANGED
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in ip2proxy_ruby.gemspec
4
4
  gemspec
5
- gem 'bindata'
5
+ gem 'bindata', "~> 2.4.15"
data/LICENSE.txt CHANGED
@@ -1,20 +1,20 @@
1
- Copyright (c) 2022 IP2Location ( support@ip2location.com )
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2016 - 2024 IP2Location ( support@ip2location.com )
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,98 +1,64 @@
1
- [![Latest Stable Version](https://img.shields.io/gem/v/ip2proxy_ruby.svg)](https://rubygems.org/gems/ip2proxy_ruby)
2
- [![Total Downloads](https://img.shields.io/gem/dt/ip2proxy_ruby.svg)](https://rubygems.org/gems/ip2proxy_ruby)
3
-
4
- # IP2Proxy Ruby Library
5
- This module allows user to reverse search of IP address to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges and residential proxies using IP2Proxy BIN database. Other information available includes proxy type, country, state, city, ISP, domain name, usage type, AS number, AS name, threats, last seen date and provider names. It lookup the proxy IP address from **IP2Proxy BIN Data** file or web service.
6
-
7
- For more details, please visit:
8
- [https://www.ip2location.com/ip2proxy/developers/ruby](https://www.ip2location.com/ip2proxy/developers/ruby)
9
-
10
- # Usage
11
- You can check the **example.rb** file to learn more about usage.
12
-
13
- ## BIN Database
14
- An outdated BIN database was provided in the library for your testing. You are recommended to visit the [links](#dependencies) to download the latest BIN database and save it in the ```rb``` folder.
15
-
16
- Below is the description of the functions available in the **BIN Database** lookup.
17
-
18
- |Method Name|Description|
19
- |---|---|
20
- |open|Open the IP2Proxy BIN data with **File I/O** mode for lookup.|
21
- |close|Close and clean up the file pointer.|
22
- |get_package_version|Get the package version (1 to 11 for PX1 to PX11 respectively).|
23
- |get_module_version|Get the module version.|
24
- |get_database_version|Get the database version.|
25
- |is_proxy|Check whether if an IP address was a proxy. Please see [Proxy Type](#proxy-type) for details. Returned value:<ul><li>-1 : errors</li><li>0 : not a proxy</li><li>1 : a proxy</li><li>2 : a data center IP address</li></ul>|
26
- |get_all|Return the proxy information in array.|
27
- |get_proxytype|Return the proxy type. Please visit <a href="https://www.ip2location.com/database/px11-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential-provider" target="_blank">IP2Location</a> for the list of proxy types supported|
28
- |get_country_short|Return the ISO3166-1 country code (2-digits) of the proxy.|
29
- |get_country_long|Return the ISO3166-1 country name of the proxy.|
30
- |get_region|Return the ISO3166-2 region name of the proxy. Please visit <a href="https://www.ip2location.com/free/iso3166-2" target="_blank">ISO3166-2 Subdivision Code</a> for the information of ISO3166-2 supported|
31
- |get_city|Return the city name of the proxy.|
32
- |get_isp|Return the ISP name of the proxy.|
33
- |get_domain|Return the domain name of proxy's IP address or domain name.|
34
- |get_usagetype|Return the ISP's usage type of proxy's IP address or domain name. Please see [Usage Type](#usage-type) for details.|
35
- |get_asn|Return the autonomous system number (ASN) of proxy's IP address or domain name.|
36
- |get_as|Return the autonomous system (AS) name of proxy's IP address or domain name.|
37
- |get_last_seen|Return the last seen days ago value of proxy's IP address or domain name.|
38
- |get_threat|Return the threat types reported to proxy's IP address or domain name. Please see [Threat Type](#threat-type) for details.|
39
- |get_provider|Returns the VPN service provider name if available.|
40
-
41
- ## Web Service
42
- Below is the description of the functions available in the **Web Service** lookup.
43
-
44
- | Function Name | Description |
45
- |---|---|
46
- | Constructor | Expect 3 input parameters:<ol><li>IP2Proxy API Key.</li><li>Package (PX1 - PX11)</li></li><li>Use HTTPS or HTTP</li></ol> |
47
- | lookup | Return the proxy information in array.<ul><li>countryCode</li><li>countryName</li><li>regionName</li><li>cityName</li><li>isp</li><li>domain</li><li>usageType</li><li>asn</li><li>as</li><li>lastSeen</li><li>threat</li><li>proxyType</li><li>isProxy</li><li>provider</li><ul> |
48
- | get_credit | Return remaining credit of the web service account. |
49
-
50
- ### Proxy Type
51
-
52
- |Proxy Type|Description|
53
- |---|---|
54
- |VPN|Anonymizing VPN services|
55
- |TOR|Tor Exit Nodes|
56
- |PUB|Public Proxies|
57
- |WEB|Web Proxies|
58
- |DCH|Hosting Providers/Data Center|
59
- |SES|Search Engine Robots|
60
- |RES|Residential Proxies [PX10+]|
61
-
62
- ### Usage Type
63
-
64
- |Usage Type|Description|
65
- |---|---|
66
- |COM|Commercial|
67
- |ORG|Organization|
68
- |GOV|Government|
69
- |MIL|Military|
70
- |EDU|University/College/School|
71
- |LIB|Library|
72
- |CDN|Content Delivery Network|
73
- |ISP|Fixed Line ISP|
74
- |MOB|Mobile ISP|
75
- |DCH|Data Center/Web Hosting/Transit|
76
- |SES|Search Engine Spider|
77
- |RSV|Reserved|
78
-
79
- ### Threat Type
80
-
81
- |Threat Type|Description|
82
- |---|---|
83
- |SPAM|Spammer|
84
- |SCANNER|Security Scanner or Attack|
85
- |BOTNET|Spyware or Malware|
86
-
87
- # Dependencies
88
-
89
- This library requires IP2Proxy BIN data file to function. You may download the BIN data file at
90
- * IP2Proxy LITE BIN Data (Free): https://lite.ip2location.com
91
- * IP2Proxy Commercial BIN Data (Comprehensive): https://www.ip2location.com/proxy-database
92
-
93
- You can also sign up for [IP2Proxy Web Service](https://www.ip2location.com/web-service/ip2proxy) to lookup by IP2Proxy API.
94
-
95
- # Support
96
-
97
- Email: support@ip2location.com
98
- URL: [https://www.ip2location.com](https://www.ip2location.com)
1
+ [![Latest Stable Version](https://img.shields.io/gem/v/ip2proxy_ruby.svg)](https://rubygems.org/gems/ip2proxy_ruby)
2
+ [![Total Downloads](https://img.shields.io/gem/dt/ip2proxy_ruby.svg)](https://rubygems.org/gems/ip2proxy_ruby)
3
+
4
+ # IP2Proxy Ruby Library
5
+ This module allows user to reverse search of IP address to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges, residential proxies, consumer privacy networks, and enterprise private networks using IP2Proxy BIN database. Other information available includes proxy type, country, state, city, ISP, domain name, usage type, AS number, AS name, threats, last seen date and provider names. It lookup the proxy IP address from **IP2Proxy BIN Data** file or web service.
6
+
7
+ For more details, please visit:
8
+ [https://www.ip2location.com/ip2proxy/developers/ruby](https://www.ip2location.com/ip2proxy/developers/ruby)
9
+
10
+ # Developer Documentation
11
+ To learn more about installation, usage, and code examples, please visit the developer documentation at [https://ip2proxy-ruby.readthedocs.io/en/latest/index.html.](https://ip2proxy-ruby.readthedocs.io/en/latest/index.html)
12
+
13
+
14
+ ### Proxy Type
15
+
16
+ |Proxy Type|Description|
17
+ |---|---|
18
+ |VPN|Anonymizing VPN services|
19
+ |TOR|Tor Exit Nodes|
20
+ |PUB|Public Proxies|
21
+ |WEB|Web Proxies|
22
+ |DCH|Hosting Providers/Data Center|
23
+ |SES|Search Engine Robots|
24
+ |RES|Residential Proxies [PX10+]|
25
+ |CPN|Consumer Privacy Networks. [PX11+]|
26
+ |EPN|Enterprise Private Networks. [PX11+]|
27
+
28
+ ### Usage Type
29
+
30
+ |Usage Type|Description|
31
+ |---|---|
32
+ |COM|Commercial|
33
+ |ORG|Organization|
34
+ |GOV|Government|
35
+ |MIL|Military|
36
+ |EDU|University/College/School|
37
+ |LIB|Library|
38
+ |CDN|Content Delivery Network|
39
+ |ISP|Fixed Line ISP|
40
+ |MOB|Mobile ISP|
41
+ |DCH|Data Center/Web Hosting/Transit|
42
+ |SES|Search Engine Spider|
43
+ |RSV|Reserved|
44
+
45
+ ### Threat Type
46
+
47
+ |Threat Type|Description|
48
+ |---|---|
49
+ |SPAM|Spammer|
50
+ |SCANNER|Security Scanner or Attack|
51
+ |BOTNET|Spyware or Malware|
52
+
53
+ # Dependencies
54
+
55
+ This library requires IP2Proxy BIN data file to function. You may download the BIN data file at
56
+ * IP2Proxy LITE BIN Data (Free): https://lite.ip2location.com
57
+ * IP2Proxy Commercial BIN Data (Comprehensive): https://www.ip2location.com/proxy-database
58
+
59
+ You can also sign up for [IP2Proxy Web Service](https://www.ip2location.com/web-service/ip2proxy) to lookup by IP2Proxy API.
60
+
61
+ # Support
62
+
63
+ Email: support@ip2location.com
64
+ URL: [https://www.ip2location.com](https://www.ip2location.com)
data/example.rb CHANGED
@@ -42,11 +42,4 @@ print 'Threat: ' + record['threat'] + "\n"
42
42
  print 'Provider: ' + record['provider'] + "\n"
43
43
 
44
44
  # close IP2Proxy BIN database
45
- i2p.close()
46
-
47
- # Web Service
48
- ws = Ip2proxyWebService.new('demo', 'PX11', true)
49
- record = ws.lookup('1.2.3.4')
50
- print record
51
- print "\n"
52
- print ws.get_credit()
45
+ i2p.close()
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "ip2proxy_ruby"
5
- s.version = "3.3.0"
5
+ s.version = "3.3.1"
6
6
  s.authors = ["ip2location"]
7
7
  s.email = ["support@ip2location.com"]
8
8
 
@@ -49,18 +49,18 @@ Gem::Specification.new do |s|
49
49
  s.specification_version = 4
50
50
 
51
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
- s.add_runtime_dependency(%q<bindata>, [">= 0"])
52
+ s.add_runtime_dependency(%q<bindata>, ["~> 2.4.15"])
53
53
  s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
54
54
  s.add_development_dependency(%q<rdoc>, [">= 6.3.1"])
55
55
  s.add_development_dependency(%q<bundler>, [">= 1.2.0"])
56
56
  else
57
- s.add_dependency(%q<bindata>, [">= 0"])
57
+ s.add_dependency(%q<bindata>, ["~> 2.4.15"])
58
58
  s.add_dependency(%q<rspec>, ["~> 2.8.0"])
59
59
  s.add_dependency(%q<rdoc>, [">= 6.3.1"])
60
60
  s.add_dependency(%q<bundler>, [">= 1.2.0"])
61
61
  end
62
62
  else
63
- s.add_dependency(%q<bindata>, [">= 0"])
63
+ s.add_dependency(%q<bindata>, ["~> 2.4.15"])
64
64
  s.add_dependency(%q<rspec>, ["~> 2.8.0"])
65
65
  s.add_dependency(%q<rdoc>, [">= 6.3.1"])
66
66
  s.add_dependency(%q<bundler>, [">= 1.2.0"])
data/lib/ip2proxy_ruby.rb CHANGED
@@ -11,7 +11,7 @@ require_relative 'ip2proxy_ruby/ip2proxy_record'
11
11
  class Ip2proxy
12
12
  attr_accessor :record_class4, :record_class6, :v4, :file, :db_index, :count, :base_addr, :ipno, :record, :database, :columns, :ip_version, :ipv4databasecount, :ipv4databaseaddr, :ipv4indexbaseaddr, :ipv6databasecount, :ipv6databaseaddr, :ipv6indexbaseaddr, :databaseyear, :databasemonth, :databaseday, :last_err_msg
13
13
 
14
- VERSION = '3.3.0'
14
+ VERSION = '3.3.1'
15
15
  FIELD_NOT_SUPPORTED = 'NOT SUPPORTED'
16
16
  INVALID_IP_ADDRESS = 'INVALID IP ADDRESS'
17
17
  INVALID_BIN_DATABASE = 'Incorrect IP2Proxy BIN file format. Please make sure that you are using the latest IP2Proxy BIN file.'
@@ -106,7 +106,7 @@ describe "Ip2proxy" do
106
106
  it "work correctly with get_module_version" do
107
107
  i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX11.SAMPLE.BIN")
108
108
  record = i2p.get_module_version()
109
- expect(record).to eq '3.3.0'
109
+ expect(record).to eq '3.3.1'
110
110
  end
111
111
 
112
112
  it "work correctly with get_package_version" do
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ip2proxy_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ip2location
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-21 00:00:00.000000000 Z
11
+ date: 2024-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 2.4.15
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 2.4.15
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.2.33
122
+ rubygems_version: 3.5.6
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: IP2Proxy Ruby library