vpndetection 5.19.0 → 5.20.1
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 +4 -4
- data/README.md +13 -0
- data/lib/vpndetection/api/account_wire_api.rb +1 -1
- data/lib/vpndetection/api/api_keys_wire_api.rb +1 -1
- data/lib/vpndetection/api/authorization_wire_api.rb +1 -1
- data/lib/vpndetection/api/database_wire_api.rb +1 -1
- data/lib/vpndetection/api/entitlement_wire_api.rb +1 -1
- data/lib/vpndetection/api/lookup_wire_api.rb +1 -1
- data/lib/vpndetection/api/organization_wire_api.rb +1 -1
- data/lib/vpndetection/api_client.rb +1 -1
- data/lib/vpndetection/api_error.rb +1 -1
- data/lib/vpndetection/api_model_base.rb +1 -1
- data/lib/vpndetection/client.rb +78 -41
- data/lib/vpndetection/configuration.rb +1 -1
- data/lib/vpndetection/middleware/core.rb +61 -5
- data/lib/vpndetection/models/abuse_contact.rb +1 -1
- data/lib/vpndetection/models/account_create_apikey_request.rb +1 -1
- data/lib/vpndetection/models/account_created_apikey.rb +1 -1
- data/lib/vpndetection/models/account_org.rb +1 -1
- data/lib/vpndetection/models/account_org_ref.rb +1 -1
- data/lib/vpndetection/models/account_org_wrap.rb +1 -1
- data/lib/vpndetection/models/account_rc.rb +1 -1
- data/lib/vpndetection/models/account_revealed_apikey.rb +1 -1
- data/lib/vpndetection/models/account_user.rb +1 -1
- data/lib/vpndetection/models/apikey_detail.rb +1 -1
- data/lib/vpndetection/models/apikey_list.rb +1 -1
- data/lib/vpndetection/models/asn.rb +1 -1
- data/lib/vpndetection/models/batch_lookup_error.rb +1 -1
- data/lib/vpndetection/models/batch_lookup_request.rb +1 -1
- data/lib/vpndetection/models/batch_lookup_response.rb +1 -1
- data/lib/vpndetection/models/bit_torrent_detail.rb +3 -3
- data/lib/vpndetection/models/bot_detail.rb +5 -5
- data/lib/vpndetection/models/carrier_detail.rb +1 -1
- data/lib/vpndetection/models/class_detail.rb +1 -1
- data/lib/vpndetection/models/client_registration.rb +1 -1
- data/lib/vpndetection/models/client_registration_request.rb +1 -1
- data/lib/vpndetection/models/company.rb +1 -1
- data/lib/vpndetection/models/database.rb +1 -1
- data/lib/vpndetection/models/database_checksums_response.rb +1 -1
- data/lib/vpndetection/models/database_format.rb +1 -1
- data/lib/vpndetection/models/database_format_size.rb +1 -1
- data/lib/vpndetection/models/database_list.rb +1 -1
- data/lib/vpndetection/models/database_metadata.rb +1 -1
- data/lib/vpndetection/models/database_metadata_column.rb +1 -1
- data/lib/vpndetection/models/database_version.rb +1 -1
- data/lib/vpndetection/models/db_checksums.rb +1 -1
- data/lib/vpndetection/models/device_authorization.rb +1 -1
- data/lib/vpndetection/models/dns_resolver_detail.rb +3 -3
- data/lib/vpndetection/models/download.rb +1 -1
- data/lib/vpndetection/models/download_list.rb +1 -1
- data/lib/vpndetection/models/entitlement.rb +1 -1
- data/lib/vpndetection/models/entitlement_apikey.rb +1 -1
- data/lib/vpndetection/models/entitlement_error.rb +1 -1
- data/lib/vpndetection/models/entitlement_plan.rb +1 -1
- data/lib/vpndetection/models/entitlement_usage.rb +1 -1
- data/lib/vpndetection/models/error_envelope.rb +1 -1
- data/lib/vpndetection/models/identity.rb +1 -1
- data/lib/vpndetection/models/location.rb +1 -1
- data/lib/vpndetection/models/lookup_error.rb +1 -1
- data/lib/vpndetection/models/lookup_response.rb +1 -1
- data/lib/vpndetection/models/oauth_error.rb +1 -1
- data/lib/vpndetection/models/oauth_metadata.rb +1 -1
- data/lib/vpndetection/models/proxy_detail.rb +1 -1
- data/lib/vpndetection/models/pubproxy_detail.rb +1 -1
- data/lib/vpndetection/models/satellite_detail.rb +1 -1
- data/lib/vpndetection/models/smtp_detail.rb +3 -3
- data/lib/vpndetection/models/ssh_detail.rb +3 -3
- data/lib/vpndetection/models/standing.rb +1 -1
- data/lib/vpndetection/models/token_response.rb +1 -1
- data/lib/vpndetection/models/user_agent_verdict.rb +1 -1
- data/lib/vpndetection/models/vpn_detail.rb +1 -1
- data/lib/vpndetection/models/web_detail.rb +3 -3
- data/lib/vpndetection/result.rb +13 -0
- data/lib/vpndetection/transport.rb +26 -5
- data/lib/vpndetection/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e98412d49d39377f043d99996c82203b2c7644033a452d76b74082335214fd7b
|
|
4
|
+
data.tar.gz: 6b8139f0a48fbd720cf9de04c7883fb0f966faf311f4ef8ca88e2084eee35547
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 22d80d7a8714065408d32933a3f9841c6609ebd689134465a69c58a2de0dd8192d52ad477a1a8894d3d6216868c85fa86cb337687588af18b67e057599f1d3af
|
|
7
|
+
data.tar.gz: eec7f92bc6b66369ea4207f2e9585b319cfcc6eff7d2bfffc899e90d17373e8bfc4cf92d688f6e997665cb7de5db713371e6931e4fb95801420e32f55169c518
|
data/README.md
CHANGED
|
@@ -72,6 +72,19 @@ Usage counts against the anniversary of your subscription on a paid plan, not th
|
|
|
72
72
|
|
|
73
73
|
Show `plan.name` and compare against `plan.key`: a plan's name can change, and its key never does. A value the API adds later to a plan's `tier`, a database's `standing` or `license_type`, a format or a download's `outcome` comes back as the string it served (from 5.16.0), so check for the values you know rather than assuming the list is complete.
|
|
74
74
|
|
|
75
|
+
### Is that crawler who it says it is?
|
|
76
|
+
|
|
77
|
+
Pass the `User-Agent` of the request you are deciding on, and with every field (a paid plan, or a free account's trial) the answer says whose agent it names and whether this address bears that out:
|
|
78
|
+
|
|
79
|
+
```ruby
|
|
80
|
+
result = client.lookup('66.249.66.1', user_agent: request.user_agent)
|
|
81
|
+
result.user_agent # => {"agent"=>"Googlebot", "kind"=>"bot", "verdict"=>"verified"}
|
|
82
|
+
|
|
83
|
+
results = client.lookup_batch(ips, user_agents: { '66.249.66.1' => request.user_agent })
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`verdict` is `verified` where the agent's operator vouches for the address, `spoofed` where it does not, `unverifiable` for a bot nothing published can confirm, and `not_bot` for a browser, an app or a script. `my_ip` takes `user_agent:` too. A batch's `user_agents` is keyed by each address as you list it, and an address with no agent, or an empty one, is looked up plainly. An answer with an agent is cached apart from the address's plain answer and from another agent's. Unlimited's answers, a private address's and a lookup that sent none carry no `user_agent` (`nil`).
|
|
87
|
+
|
|
75
88
|
### Batch lookup
|
|
76
89
|
|
|
77
90
|
Look up as many addresses as you like at once. Bogons and cached answers are handled locally, and everything else goes to the batch endpoint in chunks of up to 1000 addresses, in parallel. The batch endpoint needs a paid plan:
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
data/lib/vpndetection/client.rb
CHANGED
|
@@ -85,28 +85,37 @@ module VPNDetection
|
|
|
85
85
|
#
|
|
86
86
|
# @param retries [Integer, nil] extra attempts, for THIS call only.
|
|
87
87
|
# @param timeout [Numeric, nil] seconds each attempt may take, for THIS call only.
|
|
88
|
-
|
|
88
|
+
# @param user_agent [String, nil] the `User-Agent` of the request you are
|
|
89
|
+
# deciding on. With every field (a paid plan, or the trial) the answer then
|
|
90
|
+
# carries {Result#user_agent}: the agent it names, and whether this address
|
|
91
|
+
# bears that out. An empty one is none. An answer with one is cached apart
|
|
92
|
+
# from the address's plain answer and from another agent's. A bogon is still
|
|
93
|
+
# answered locally, with no `user_agent`.
|
|
94
|
+
# @raise [ArgumentError] for a `user_agent` that is not a String.
|
|
95
|
+
def lookup(ip, retries: nil, timeout: nil, user_agent: nil)
|
|
89
96
|
# Here as well as in the transport: a bogon or a cached answer returns before any request.
|
|
90
97
|
Transport.checked_timeout(timeout) unless timeout.nil?
|
|
91
98
|
Retries.checked_count(retries) unless retries.nil?
|
|
99
|
+
agent = Transport.checked_user_agent(user_agent)
|
|
92
100
|
# Judged, cached and sent as the IPv4 address it carries, if it is mapped.
|
|
93
101
|
ip = Bogon.unmapped(ip)
|
|
94
102
|
return Bogon.result(ip) if Bogon.bogon?(ip)
|
|
95
103
|
|
|
104
|
+
key = key_of(ip, agent)
|
|
96
105
|
loop do
|
|
97
|
-
hit = @cache&.get(
|
|
106
|
+
hit = @cache&.get(key)
|
|
98
107
|
return hit unless hit.nil?
|
|
99
108
|
|
|
100
|
-
flight, leader = board(
|
|
101
|
-
return fetch(ip, retries, timeout) if flight.nil?
|
|
109
|
+
flight, leader = board(key)
|
|
110
|
+
return fetch(ip, agent, retries, timeout) if flight.nil?
|
|
102
111
|
|
|
103
112
|
if leader
|
|
104
113
|
# Read once more now the address is boarded: a leader that landed
|
|
105
114
|
# between the miss above and boarding has already cached its answer.
|
|
106
|
-
hit = @cache.get(
|
|
107
|
-
return unboard(
|
|
115
|
+
hit = @cache.get(key)
|
|
116
|
+
return unboard(key, flight, :served, hit) unless hit.nil?
|
|
108
117
|
|
|
109
|
-
return lead(
|
|
118
|
+
return lead(key, flight) { fetch(ip, agent, retries, timeout) }
|
|
110
119
|
end
|
|
111
120
|
state, value = flight.wait
|
|
112
121
|
return value if state == :served
|
|
@@ -125,10 +134,13 @@ module VPNDetection
|
|
|
125
134
|
# Deliberately NOT cached. The cache is keyed by address, and which address
|
|
126
135
|
# this is IS the question: a machine that moves between networks would
|
|
127
136
|
# otherwise be told where it used to be.
|
|
128
|
-
|
|
137
|
+
#
|
|
138
|
+
# @param user_agent [String, nil] as {#lookup} takes it.
|
|
139
|
+
def my_ip(retries: nil, timeout: nil, user_agent: nil)
|
|
129
140
|
Retries.checked_count(retries) unless retries.nil?
|
|
141
|
+
agent = Transport.checked_user_agent(user_agent)
|
|
130
142
|
Retries.with_retries(retries || @retries) do
|
|
131
|
-
Transport.lookup_result(@transport.myip_request(timeout: timeout).run)
|
|
143
|
+
Transport.lookup_result(@transport.myip_request(timeout: timeout, user_agent: agent).run)
|
|
132
144
|
end
|
|
133
145
|
end
|
|
134
146
|
|
|
@@ -179,32 +191,47 @@ module VPNDetection
|
|
|
179
191
|
# request, and before a bogon or a cached answer is returned.
|
|
180
192
|
# @param retries [Integer, nil] extra attempts for a failed chunk, for THIS batch only.
|
|
181
193
|
# @param timeout [Numeric, nil] seconds each chunk's attempt may take, for THIS batch only.
|
|
194
|
+
# @param user_agents [Hash{String => String}, nil] the `User-Agent` to send
|
|
195
|
+
# with each address, keyed by the address as given in `ips`: as
|
|
196
|
+
# {#lookup}'s `user_agent:`, per address. An address with none, or an empty
|
|
197
|
+
# one, is looked up plainly. Where two spellings of one IPv4-mapped address
|
|
198
|
+
# carry different agents, the first given is sent.
|
|
199
|
+
# @raise [ArgumentError] for `user_agents` that is not a Hash, or an agent in
|
|
200
|
+
# it that is not a String.
|
|
182
201
|
# @return [Hash{String => Result, Error}] in the order the addresses were given
|
|
183
|
-
def lookup_batch(ips, concurrency: nil, retries: nil, timeout: nil)
|
|
202
|
+
def lookup_batch(ips, concurrency: nil, retries: nil, timeout: nil, user_agents: nil)
|
|
184
203
|
limit = concurrency || @concurrency
|
|
185
204
|
unless concurrency?(limit)
|
|
186
205
|
raise Error.new(:bad_request, "concurrency must be an Integer from 1, not #{limit.inspect}")
|
|
187
206
|
end
|
|
188
207
|
Transport.checked_timeout(timeout) unless timeout.nil?
|
|
189
208
|
Retries.checked_count(retries) unless retries.nil?
|
|
209
|
+
unless user_agents.nil? || user_agents.is_a?(Hash)
|
|
210
|
+
raise ArgumentError, "user_agents must be a Hash of address to agent, not #{user_agents.inspect}"
|
|
211
|
+
end
|
|
190
212
|
|
|
191
213
|
# An IPv4-mapped address is sent as the address it carries, once however
|
|
192
214
|
# many of its spellings were asked, and answered under each one asked.
|
|
193
215
|
asked = ips.to_a.uniq
|
|
216
|
+
agents = {}
|
|
217
|
+
asked.each do |ip|
|
|
218
|
+
agent = Transport.checked_user_agent(user_agents&.[](ip))
|
|
219
|
+
agents[Bogon.unmapped(ip)] ||= agent unless agent.nil?
|
|
220
|
+
end
|
|
194
221
|
addresses = asked.map { |ip| Bogon.unmapped(ip) }.uniq
|
|
195
222
|
answers = {}
|
|
196
223
|
pending = []
|
|
197
224
|
|
|
198
225
|
addresses.each do |ip|
|
|
199
|
-
hit = Bogon.bogon?(ip) ? Bogon.result(ip) : @cache&.get(ip)
|
|
226
|
+
hit = Bogon.bogon?(ip) ? Bogon.result(ip) : @cache&.get(key_of(ip, agents[ip]))
|
|
200
227
|
hit.nil? ? pending << ip : answers[ip] = hit
|
|
201
228
|
end
|
|
202
229
|
# Boarded before any chunk is built, so a lookup arriving meanwhile waits
|
|
203
|
-
# for this batch; an address already in flight is not sent again.
|
|
230
|
+
# for this batch; an address and agent already in flight is not sent again.
|
|
204
231
|
boarded = {}
|
|
205
232
|
joined = {}
|
|
206
233
|
pending.each do |ip|
|
|
207
|
-
flight, leader = board(ip)
|
|
234
|
+
flight, leader = board(key_of(ip, agents[ip]))
|
|
208
235
|
if leader == false
|
|
209
236
|
joined[ip] = flight
|
|
210
237
|
else
|
|
@@ -214,12 +241,12 @@ module VPNDetection
|
|
|
214
241
|
begin
|
|
215
242
|
unless boarded.empty?
|
|
216
243
|
chunks = boarded.keys.each_slice(BATCH_MAX).to_a
|
|
217
|
-
run_batch(chunks, answers, limit, retries || @retries, timeout, boarded)
|
|
244
|
+
run_batch(chunks, agents, answers, limit, retries || @retries, timeout, boarded)
|
|
218
245
|
end
|
|
219
246
|
ensure
|
|
220
|
-
boarded.each { |ip, flight| unboard(ip, flight, :abandoned) unless flight.nil? }
|
|
247
|
+
boarded.each { |ip, flight| unboard(key_of(ip, agents[ip]), flight, :abandoned) unless flight.nil? }
|
|
221
248
|
end
|
|
222
|
-
joined.each { |ip, flight| answers[ip] = joined_answer(ip, flight, retries, timeout) }
|
|
249
|
+
joined.each { |ip, flight| answers[ip] = joined_answer(ip, agents[ip], flight, retries, timeout) }
|
|
223
250
|
|
|
224
251
|
# Reinstated in input order: a hydra settles in completion order, and a
|
|
225
252
|
# caller iterating the hash should see what they passed in.
|
|
@@ -234,6 +261,13 @@ module VPNDetection
|
|
|
234
261
|
value.is_a?(Integer) && value >= 1
|
|
235
262
|
end
|
|
236
263
|
|
|
264
|
+
# What an answer is cached and shared under: the address alone, or the
|
|
265
|
+
# address and the agent sent with it, since that answer carries a verdict
|
|
266
|
+
# the plain one does not.
|
|
267
|
+
def key_of(ip, agent)
|
|
268
|
+
agent.nil? ? ip : [ip, agent]
|
|
269
|
+
end
|
|
270
|
+
|
|
237
271
|
# Concurrent misses for one address share ONE request: 5.4.2 sent one per
|
|
238
272
|
# calling thread. The first miss boards the
|
|
239
273
|
# address and every miss after it, a batch's included, waits on its Flight.
|
|
@@ -265,21 +299,21 @@ module VPNDetection
|
|
|
265
299
|
end
|
|
266
300
|
end
|
|
267
301
|
|
|
268
|
-
# [flight, true] when this caller leads the request for `
|
|
269
|
-
# false] when one is already in flight,
|
|
270
|
-
# lookup is then served, so nothing is shared.
|
|
271
|
-
def board(
|
|
302
|
+
# [flight, true] when this caller leads the request for `key`, an address
|
|
303
|
+
# or an address and agent, [flight, false] when one is already in flight,
|
|
304
|
+
# and nil without a cache: every lookup is then served, so nothing is shared.
|
|
305
|
+
def board(key)
|
|
272
306
|
return nil if @cache.nil?
|
|
273
307
|
|
|
274
308
|
@flights_lock.synchronize do
|
|
275
|
-
existing = @flights[
|
|
276
|
-
existing ? [existing, false] : [@flights[
|
|
309
|
+
existing = @flights[key]
|
|
310
|
+
existing ? [existing, false] : [@flights[key] = Flight.new, true]
|
|
277
311
|
end
|
|
278
312
|
end
|
|
279
313
|
|
|
280
|
-
# Takes `
|
|
281
|
-
def unboard(
|
|
282
|
-
@flights_lock.synchronize { @flights.delete(
|
|
314
|
+
# Takes `key` off the board and lands its flight. Returns `value`.
|
|
315
|
+
def unboard(key, flight, state, value = nil)
|
|
316
|
+
@flights_lock.synchronize { @flights.delete(key) if @flights[key].equal?(flight) }
|
|
283
317
|
flight.land(state, value)
|
|
284
318
|
value
|
|
285
319
|
end
|
|
@@ -289,39 +323,42 @@ module VPNDetection
|
|
|
289
323
|
# reaches every waiter and is cached for none; and a leader that never
|
|
290
324
|
# finishes - a killed thread, a Timeout.timeout - abandons the flight, so
|
|
291
325
|
# its waiters ask again rather than failing with it.
|
|
292
|
-
def lead(
|
|
293
|
-
unboard(
|
|
326
|
+
def lead(key, flight)
|
|
327
|
+
unboard(key, flight, :served, yield)
|
|
294
328
|
rescue Error => e
|
|
295
|
-
unboard(
|
|
329
|
+
unboard(key, flight, :failed, e)
|
|
296
330
|
raise
|
|
297
331
|
ensure
|
|
298
|
-
unboard(
|
|
332
|
+
unboard(key, flight, :abandoned)
|
|
299
333
|
end
|
|
300
334
|
|
|
301
|
-
def fetch(ip, retries, timeout)
|
|
335
|
+
def fetch(ip, agent, retries, timeout)
|
|
302
336
|
result = Retries.with_retries(retries || @retries) do
|
|
303
|
-
Transport.lookup_result(@transport.lookup_request(ip, timeout: timeout).run)
|
|
337
|
+
Transport.lookup_result(@transport.lookup_request(ip, timeout: timeout, user_agent: agent).run)
|
|
304
338
|
end
|
|
305
|
-
@cache&.set(ip, result)
|
|
339
|
+
@cache&.set(key_of(ip, agent), result)
|
|
306
340
|
result
|
|
307
341
|
end
|
|
308
342
|
|
|
309
343
|
# One hydra per call, sized for THIS call. Reusing an instance-level hydra
|
|
310
344
|
# would silently cap a per-call concurrency at the client's setting, and
|
|
311
345
|
# would not be safe to drive from two threads either. Each request is one
|
|
312
|
-
# chunk of up to 1000 addresses
|
|
313
|
-
|
|
346
|
+
# chunk of up to 1000 addresses, carrying the agents of that chunk's
|
|
347
|
+
# addresses alone.
|
|
348
|
+
def run_batch(chunks, agents, answers, concurrency, retries, timeout, boarded)
|
|
314
349
|
hydra = Typhoeus::Hydra.new(max_concurrency: concurrency)
|
|
315
350
|
attempts = Hash.new(0)
|
|
316
351
|
|
|
317
352
|
enqueue = lambda do |chunk|
|
|
318
|
-
|
|
353
|
+
sent = chunk.filter_map { |ip| [ip, agents[ip]] if agents.key?(ip) }.to_h
|
|
354
|
+
request = @transport.batch_request(chunk, timeout: timeout, user_agents: sent)
|
|
319
355
|
request.on_complete do |response|
|
|
320
|
-
outcome = settle(chunk, response, attempts, retries, enqueue)
|
|
356
|
+
outcome = settle(chunk, agents, response, attempts, retries, enqueue)
|
|
321
357
|
outcome&.each do |ip, answer|
|
|
322
358
|
answers[ip] = answer
|
|
323
359
|
flight = boarded[ip]
|
|
324
|
-
|
|
360
|
+
state = answer.is_a?(Result) ? :served : :failed
|
|
361
|
+
unboard(key_of(ip, agents[ip]), flight, state, answer) unless flight.nil?
|
|
325
362
|
end
|
|
326
363
|
end
|
|
327
364
|
hydra.queue(request)
|
|
@@ -335,11 +372,11 @@ module VPNDetection
|
|
|
335
372
|
# chunk-level failure - the call refused, the transport failing, the retries
|
|
336
373
|
# exhausted - becomes every address's error, exactly as it would have been
|
|
337
374
|
# had each been looked up alone.
|
|
338
|
-
def settle(chunk, response, attempts, retries, enqueue)
|
|
375
|
+
def settle(chunk, agents, response, attempts, retries, enqueue)
|
|
339
376
|
body = Transport.batch_body(response)
|
|
340
377
|
chunk.to_h do |ip|
|
|
341
378
|
answer = batch_answer(ip, body)
|
|
342
|
-
@cache&.set(ip, answer) if answer.is_a?(Result)
|
|
379
|
+
@cache&.set(key_of(ip, agents[ip]), answer) if answer.is_a?(Result)
|
|
343
380
|
[ip, answer]
|
|
344
381
|
end
|
|
345
382
|
rescue Error => e
|
|
@@ -355,11 +392,11 @@ module VPNDetection
|
|
|
355
392
|
|
|
356
393
|
# What a batch takes for an address another call was fetching: that call's
|
|
357
394
|
# answer or error, or, when its leader never finished, its own lookup.
|
|
358
|
-
def joined_answer(ip, flight, retries, timeout)
|
|
395
|
+
def joined_answer(ip, agent, flight, retries, timeout)
|
|
359
396
|
state, value = flight.wait
|
|
360
397
|
return value unless state == :abandoned
|
|
361
398
|
|
|
362
|
-
lookup(ip, retries: retries, timeout: timeout)
|
|
399
|
+
lookup(ip, retries: retries, timeout: timeout, user_agent: agent)
|
|
363
400
|
rescue Error => e
|
|
364
401
|
e
|
|
365
402
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -27,14 +27,29 @@ module VPNDetection
|
|
|
27
27
|
DEFAULT_TIMEOUT = 2.5
|
|
28
28
|
DEFAULT_RETRIES = 0
|
|
29
29
|
|
|
30
|
+
# Reads a request's `User-Agent` where the adapter names no reader: Rack's
|
|
31
|
+
# request has `user_agent`, and so do Sinatra's and Hanami's.
|
|
32
|
+
DEFAULT_USER_AGENT = ->(request) { request.user_agent if request.respond_to?(:user_agent) }
|
|
33
|
+
|
|
30
34
|
# Resolve, classify, decide.
|
|
31
35
|
class Core
|
|
32
36
|
# @param default_ip_selector [#call] the framework's own accessor, used
|
|
33
37
|
# when the caller named none.
|
|
34
|
-
|
|
38
|
+
# @param user_agent_of [#call] reads the request's own `User-Agent`, which
|
|
39
|
+
# `allow_bots: true` sends with the lookup.
|
|
40
|
+
# @option options [Boolean] :allow_bots (false) send the request's own
|
|
41
|
+
# `User-Agent` with its lookup, and never refuse a request whose answer
|
|
42
|
+
# says `user_agent.verdict` is `verified`, whatever the condition
|
|
43
|
+
# matches; the answer is still attached. An absent or empty header sends
|
|
44
|
+
# none. A keyless client, or a free key past its trial, never gets a
|
|
45
|
+
# verdict, so nothing is let through there, and that is warned of once
|
|
46
|
+
# under `on_missing_field`.
|
|
47
|
+
def initialize(default_ip_selector, user_agent_of = DEFAULT_USER_AGENT, **options)
|
|
35
48
|
Condition.validate!(options[:block_condition])
|
|
36
49
|
@condition = options[:block_condition]
|
|
37
50
|
@selector = options[:ip_selector] || default_ip_selector
|
|
51
|
+
@allow_bots = options.fetch(:allow_bots, false) == true
|
|
52
|
+
@user_agent_of = user_agent_of
|
|
38
53
|
@fail_closed = options.fetch(:fail_closed, false)
|
|
39
54
|
@on_missing_field = options.fetch(:on_missing_field, :warn)
|
|
40
55
|
@skip = options[:skip]
|
|
@@ -76,12 +91,14 @@ module VPNDetection
|
|
|
76
91
|
)
|
|
77
92
|
end
|
|
78
93
|
|
|
94
|
+
# A bogon is answered locally, so nothing is sent for it.
|
|
95
|
+
agent = @allow_bots && !Bogon.bogon?(ip) ? user_agent(request) : nil
|
|
79
96
|
begin
|
|
80
|
-
result = @client.lookup(ip, retries: @retries)
|
|
97
|
+
result = @client.lookup(ip, retries: @retries, **(agent ? { user_agent: agent } : {}))
|
|
81
98
|
rescue VPNDetection::Error => e
|
|
82
99
|
return Lookup.new(blocked: @fail_closed, ip: ip, error: e)
|
|
83
100
|
end
|
|
84
|
-
decide(ip, result)
|
|
101
|
+
decide(ip, result, agent)
|
|
85
102
|
end
|
|
86
103
|
|
|
87
104
|
private
|
|
@@ -97,19 +114,35 @@ module VPNDetection
|
|
|
97
114
|
)
|
|
98
115
|
end
|
|
99
116
|
|
|
100
|
-
|
|
117
|
+
# The request's own `User-Agent`, or nil when it sent none or an empty one.
|
|
118
|
+
def user_agent(request)
|
|
119
|
+
agent = @user_agent_of.call(request)
|
|
120
|
+
agent.is_a?(String) && !agent.empty? ? agent : nil
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def decide(ip, result, agent)
|
|
124
|
+
report_unanswered_agent(result) unless agent.nil?
|
|
101
125
|
return Lookup.new(blocked: false, ip: ip, result: result) if @condition.nil?
|
|
102
126
|
|
|
103
127
|
report_missing(result)
|
|
104
128
|
Lookup.new(
|
|
105
|
-
blocked: Condition.matches?(@condition, result),
|
|
129
|
+
blocked: Condition.matches?(@condition, result) && !verified?(result),
|
|
106
130
|
ip: ip,
|
|
107
131
|
result: result
|
|
108
132
|
)
|
|
109
133
|
end
|
|
110
134
|
|
|
135
|
+
# Whether `allow_bots` lets this answer through: its agent's operator
|
|
136
|
+
# vouches for the address.
|
|
137
|
+
def verified?(result)
|
|
138
|
+
@allow_bots && result.user_agent.is_a?(Hash) && result.user_agent['verdict'] == 'verified'
|
|
139
|
+
end
|
|
140
|
+
|
|
111
141
|
def report_missing(result)
|
|
112
142
|
return if @on_missing_field == :ignore
|
|
143
|
+
# A bogon is answered locally in the widest shape, which carries every
|
|
144
|
+
# member but `user_agent`, and no agent is sent for it.
|
|
145
|
+
return if result.bogon?
|
|
113
146
|
|
|
114
147
|
missing = Condition.missing_members(@condition, result)
|
|
115
148
|
return if missing.empty?
|
|
@@ -117,6 +150,24 @@ module VPNDetection
|
|
|
117
150
|
message = "block_condition names #{missing.join(', ')}, which your plan does not " \
|
|
118
151
|
'include, so those terms can never match. An absent member means "not in ' \
|
|
119
152
|
'your plan", not "checked, and no".'
|
|
153
|
+
if missing.include?('user_agent') && !@allow_bots
|
|
154
|
+
message += ' user_agent is answered only to a lookup that sends one, which allow_bots does.'
|
|
155
|
+
end
|
|
156
|
+
report(message)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# An agent went with the lookup and the served answer carries no verdict:
|
|
160
|
+
# a keyless client, or a free key past its trial, is never answered one,
|
|
161
|
+
# so allow_bots lets no crawler through.
|
|
162
|
+
def report_unanswered_agent(result)
|
|
163
|
+
return if @on_missing_field == :ignore || result.included?(:user_agent)
|
|
164
|
+
|
|
165
|
+
report('allow_bots sends the request\'s User-Agent, but the answer carries no user_agent ' \
|
|
166
|
+
'verdict, which your plan does not include, so no crawler is let through. A key on ' \
|
|
167
|
+
'a paid plan, or on its trial, is answered one.')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def report(message)
|
|
120
171
|
raise ArgumentError, "vpndetection: #{message}" if @on_missing_field == :raise
|
|
121
172
|
|
|
122
173
|
warn_once(message)
|
|
@@ -147,6 +198,11 @@ module VPNDetection
|
|
|
147
198
|
->(request) { @view.call(request).framework_ip.call }
|
|
148
199
|
end
|
|
149
200
|
|
|
201
|
+
# The request's own `User-Agent` header, which `allow_bots` sends.
|
|
202
|
+
def user_agent
|
|
203
|
+
->(request) { @view.call(request).header.call('User-Agent') }
|
|
204
|
+
end
|
|
205
|
+
|
|
150
206
|
# An address from `X-Forwarded-For`.
|
|
151
207
|
#
|
|
152
208
|
# The LEFT-MOST entry (depth 0) is whatever the caller sent, because
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.23
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|