On this page
Every check on a request path needs an answer to one question: what happens when it doesn't answer? Most apps answer it by accident, with whatever their HTTP client does by default. On December 1, 2026, our own Node.js client, on its defaults, held a lookup for 34.5 seconds against an API that never answered, then raised an error. Our Express middleware, on its defaults, gave up after 2.5 seconds and let the visitor through. Neither is right for every route.
This post measures how often the check fails, breaks it in an Express app, and gives each kind of route its own default.
How often the check doesn't answer
The time our edge spent on each successful lookup, from the request arriving to the answer leaving, over the 28 days to November 13, 2026:
| Percentile | Time at our edge |
|---|---|
| Median | 6 ms |
| 95th | 16 ms |
| 99th | 58 ms |
| 99.9th | 228 ms |
No lookup in those 28 days got a server error. A few requests got no response at all, and each was a client that hung up before it had finished sending its request. That's what reached our edge. An outage that kept requests from reaching it would show on our status page, which keeps the history.
The rest of the wait is the network. Our API runs in Finland (DPA), and a cold HTTPS call makes three round trips to it before the answer starts back: one to connect, one for TLS and one for the request. A call over a connection already open makes one. From a server in Helsinki, next door to the API, the median of three cold calls was 22 ms:
$ curl -s -o /dev/null https://api.vpndetection.io/45.134.140.130 \
-w 'connect %{time_connect}s tls %{time_appconnect}s total %{time_total}s\n'
connect 0.002094s tls 0.019026s total 0.022186sConnecting took 2.1 ms, one round trip from there. Most of the 22 ms was the TLS handshake's own work. Over a connection already open, the median was 4 ms. From farther away, each round trip adds your distance to Finland: run the command from your own server to see it.
The other failures an app can meet are its own: a burst (429 with Retry-After) and the network between you and us. The rate limits page says how to read a 429.
Breaking it two ways
The app has three routes, each failing its own way. It uses our Express middleware, vpndetection-express, which fails open unless told otherwise, and one client for all three, so they share its cache:
import express from 'express';
import { VPNDetection } from 'vpndetection';
import { vpndetection } from 'vpndetection-express';
const app = express();
app.set('trust proxy', 'loopback');
// One client, so every route shares one cache: an hour per address.
const client = new VPNDetection();
function logFailure(req) {
const { ip, error } = req.vpndetection;
console.warn(`vpn check failed for ${ip}: ${error.kind}: ${error.message}`);
}
// Pages: fail open, and fast.
app.get('/', vpndetection({ client, timeoutMs: 1000 }), (req, res) => {
if (req.vpndetection.error) logFailure(req);
res.json({ page: 'home' });
});
// Signup: fail open, into the same check a flagged address gets.
app.post('/signup', vpndetection({ client }), (req, res) => {
const { result, error } = req.vpndetection;
if (error) {
logFailure(req);
return res.json({ decision: 'verify', reason: 'no answer' });
}
// A private address means a proxy we don't trust hid the visitor.
if (result.isBogon || result.isVpn || result.isTor) {
return res.json({ decision: 'verify', reason: 'flagged' });
}
res.json({ decision: 'allow' });
});
// Payouts: fail closed. No answer, no payout, and the answer says why.
const payoutCheck = vpndetection({
client,
timeoutMs: 3000,
retries: 1,
failClosed: true,
blockCondition: [{ isVpn: true }, { isTor: true }, { isBogon: true }],
onBlocked: (req, res, lookup) => {
if (lookup.error) {
logFailure(req);
res.set('Retry-After', '60');
return res.status(503).json({ error: 'payouts paused, retry later' });
}
res.status(403).json({ error: 'payouts need a direct connection' });
},
});
app.post('/payout', payoutCheck, (req, res) => res.json({ decision: 'paid' }));
app.listen(3000);failClosed turns a failed lookup into a block, and onBlocked tells the two apart: lookup.error is set only when the lookup failed. The app acts on isVpn and isTor, which the free plan answers. Which flags a route should act on is a decision of its own. This post is about what to do when none come back.
We ran it on December 1, 2026, with Node.js 22.23, Express 5.3.0, vpndetection 6.0.0 and vpndetection-express 3.0.0, and every output below comes from those releases. Each request was sent from loopback with the address of Mullvad's Atlanta server, from Mullvad's own list, in X-Forwarded-For:
for r in 'GET /' 'POST /signup' 'POST /payout'; do
curl -s -X "${r% *}" -H 'X-Forwarded-For: 45.134.140.130' \
-w ' %{http_code} %{time_total}s\n' "localhost:3000${r#* }"
doneTo break the API, we pointed its hostname elsewhere in the app's hosts file: at 127.0.0.1, where nothing listens, for an API that refuses connections, and at 192.0.2.1, an address set aside for documentation that nothing answers, for one that never answers. Times are the median of three runs:
| What happened | GET /, fails open | POST /signup, fails open to a check | POST /payout, fails closed |
|---|---|---|---|
| API answered | 200 in 0.04 s | verify, flagged | 403 |
| API refused connections | 200 | verify, no answer | 503 after 1.0 s |
| API never answered | 200 after 1.0 s | verify, no answer, after 2.5 s | 503 after 7.0 s |
With the API answering, signup and payout took about a millisecond each: the page's lookup had already put Mullvad's answer in the shared cache. A failure is never cached, so the next request asks again.
Where the API never answered, the second of the three runs printed:
{"page":"home"} 200 1.003447s
{"decision":"verify","reason":"no answer"} 200 2.502374s
{"error":"payouts paused, retry later"} 503 7.002924sThe payout waited 3 seconds, 1 more before its one retry, then 3 again. Where connections were refused, each attempt failed at once, so the retry cost only the 1-second wait.

What the log says
The app logged, for refused connections and then an API that never answered:
vpn check failed for 45.134.140.130: network: no response from the API
vpn check failed for 45.134.140.130: network: request timed out after 2500msRead error.kind and act on it:
networkorserver_error: the API or the network to it. Fail the way the route says.rate_limited: a burst. A route with a retry waits outRetry-After, however long it is, and asks again, so a payout can wait well past 7 seconds. One with none fails the way the route says.bad_request: no usable client address on the request, usually your proxy settings. Fail the way the route says, and fix them.
Fail open or fail closed, route by route
Decide by what each mistake costs. A missed VPN on a page costs nothing, and a 3-second wait during an outage costs every visitor. A missed VPN on a payout sends money that doesn't come back, and a refused payout can wait a minute.
| Route | When the check doesn't answer | Timeout and retries |
|---|---|---|
| Pages, search, content | Fail open | 1 s or less, none |
| Sign-in for existing accounts | Fail open: the password is the check | The middleware's 2.5 s, none |
| Signup, free trials, coupons | Fail open, into the check a flagged address gets: email or phone verification | 2.5 s, none |
| Checkout | Fail open, into 3-D Secure | 2.5 s, none |
| Payouts, withdrawals, gift cards | Fail closed, with a 503, Retry-After and words saying it's paused | 3 s, one |
| Playback licensed by country | Fail closed: the license doesn't bend for an outage | 3 s, one |
| Signup during a bot attack | Fail closed, until the attack ends | 2.5 s, none |
A route that fails open into a check gets the step-up whether the lookup said VPN or said nothing. Our UK Online Safety Act post does the same with age assurance: a failed lookup is not an answer.
The base client's defaults are for batch jobs
The base client, VPNDetection, waits 30 seconds per attempt and retries twice, which suits a nightly job scoring a table of signups. In front of a visitor it doesn't. Against 192.0.2.1, where nothing answers, one lookup on those defaults took 34.5 seconds in each of three runs: three attempts of 10.5 seconds, each cut short by Node's own connect timeout before the client's 30 seconds came up, with 1 and 2 seconds between them. Against an API that accepted connections and then stalled, the 30 seconds would apply instead.
Each of our middleware packages has its own defaults for the request path: 2.5 seconds, no retry, and fail open. Pass the timeout per route, as the app above does, rather than changing the client's.
Take the check off the request path where you can
- Look up once and store the answer. A signup's verdict goes on the account. Sign-ins and later requests read it, and nothing waits on us.
- Share one client. Its cache keeps up to 10,000 answers in memory, each for an hour. Two routes asking about one address at once share one lookup, made with the settings of the route that asked first.
- Above a few million distinct addresses a day, look up from a copy of the databases on your own servers. A lookup there never leaves your network, so it has nothing to fail open or closed on. An IP list in Cloudflare or AWS WAF answers at your edge too, within the list sizes that post measures.
A paid plan's key, and a wrong one
A paid plan's key answers every field, the proxy flags among them. Create one in the console, where a free account can try every field, and give it to the shared client:
const client = new VPNDetection({ apiKey: process.env.VPNDETECTION_API_KEY });A wrong key looks like an outage, and lasts longer: the page and signup kept working with no address checked, the payout answered 503, and the log read:
vpn check failed for 45.134.140.130: unauthorized: invalid API keyThat is what failing open does to a mistake of yours: it hides it until someone reads the log.
A key that has used its lookups with every field does the same. Past them, a free plan's key for the rest of the UTC day, and a paid plan's once its month's lookups and any overage you allow are used, each answer carries the basics and no VPN flag. Since vpndetection 6.0.0 that answer raises quota_exceeded, and the middleware treats the lookup as failed. Against a stand-in for our API answering as it does past the cap, the three routes answered as they did for the wrong key, and the log line read quota_exceeded: the organization's lookups with every field are used, beside a warning from the middleware itself.
unauthorized or forbidden is your key: alert someone, since nothing fixes it but a person. quota_exceeded is your allowance: alert on it too, since every route runs unchecked until it renews or you raise it. Pricing lists what each plan adds.
The middleware for each framework is in the docs, starting from our Express tutorial, and the API page shows what a lookup returns.


