Skip to content

Commit 0e00692

Browse files
committed
Added support for AIC proxy type for is_proxy field
1 parent e8ad344 commit 0e00692

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ To learn more about installation, usage, and code examples, please visit the dev
2424
|RES|Residential Proxies [PX10+]|
2525
|CPN|Consumer Privacy Networks. [PX11+]|
2626
|EPN|Enterprise Private Networks. [PX11+]|
27+
|AIC|AI Crawler. [PX12]|
2728

2829
### Usage Type
2930

@@ -41,6 +42,7 @@ To learn more about installation, usage, and code examples, please visit the dev
4142
|DCH|Data Center/Web Hosting/Transit|
4243
|SES|Search Engine Spider|
4344
|RSV|Reserved|
45+
|AIC|AI Crawler|
4446

4547
### Threat Type
4648

docs/source/code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Retrieve geolocation information for an IP address.
3939
4040
| Field Name | Description |
4141
| ---------------- | ------------------------------------------------------------ |
42-
| is_proxy | Determine whether if an IP address was a proxy or not. Returns 0 is not proxy, 1 if proxy, and 2 if it's data center IP |
42+
| is_proxy | Determine whether if an IP address was a proxy or not. Returns 0 is not proxy, 1 if proxy, and 2 if it's data center IP, search engine IP or AI Crawler IP. |
4343
| country_short | Two-character country code based on ISO 3166. |
4444
| country_long | Country name based on ISO 3166. |
4545
| region | Region or state name. |

ip2proxy_ruby.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gem::Specification.new do |s|
44
s.name = "ip2proxy_ruby"
5-
s.version = "3.4.0"
5+
s.version = "3.5.0"
66
s.authors = ["ip2location"]
77
s.email = ["support@ip2location.com"]
88

lib/ip2proxy_ruby.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class Ip2proxy
1212
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
1313

14-
VERSION = '3.4.0'
14+
VERSION = '3.5.0'
1515
FIELD_NOT_SUPPORTED = 'NOT SUPPORTED'
1616
INVALID_IP_ADDRESS = 'INVALID IP ADDRESS'
1717
INVALID_BIN_DATABASE = 'Incorrect IP2Proxy BIN file format. Please make sure that you are using the latest IP2Proxy BIN file.'
@@ -296,7 +296,7 @@ def is_proxy(ip)
296296
if self.db_index == 1
297297
isproxy = (rec.country_short == '-') ? 0 : 1
298298
else
299-
isproxy = (rec.proxytype == '-') ? 0 : (rec.proxytype == 'DCH' || rec.proxytype == 'SES') ? 2 : 1
299+
isproxy = (rec.proxytype == '-') ? 0 : (rec.proxytype == 'DCH' || rec.proxytype == 'SES' || rec.proxytype == 'AIC') ? 2 : 1
300300
end
301301
else
302302
isproxy = -1

spec/ip2proxy_ruby_database_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
it "work correctly with get_module_version" do
113113
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
114114
record = i2p.get_module_version()
115-
expect(record).to eq '3.4.0'
115+
expect(record).to eq '3.5.0'
116116
end
117117

118118
it "work correctly with get_package_version" do

0 commit comments

Comments
 (0)