Firewall
How every published app is protected from floods and fake browsers, and how to add a human check for cloud visitors, rate limits on your paths, and a log of where your traffic comes from.
Floot's firewall decides which requests reach your published app before your app runs. Some protection is always on. In Services → Firewall you can add three things of your own: a human check for visitors from cloud servers, rate limits on your app's paths, and a recording of where your traffic comes from.
What every app gets
Every published app slows down a caller that floods it with requests and blocks programs that pretend to be a browser. There's nothing to set up, and requests refused this way never reach your app, so they cost you no hosting. A caller over these limits gets a 429 answer with the code floot_rate_limited.
Ask visitors from cloud servers to prove they're human
Headless browsers running in data centers can load every page of your app, and each load can call your backend and run up your hosting. With Ask visitors from cloud servers to prove they're human on, a page load from a data-center network gets a quick puzzle (a CAPTCHA) before your app runs. Visitors on home and mobile networks almost never see it, and someone who solves it isn't asked again for an hour.
- Only page loads are checked. Calls to your app's API (
/_api/...), webhooks and file downloads are never asked. - Free on every plan. Anyone who can publish the project can turn it on or off.
- When it takes effect: on a published app, within a few minutes. Otherwise at the next publish.
Some real visitors browse from cloud networks
People on a VPN or a work proxy, AI assistants that open pages for someone, and uptime or test checks will get the puzzle too. If your app relies on any of them, try it and watch for complaints, or leave it off.
Rate limits
A rate limit refuses requests to a path once there are too many in a set time, from one visitor or from all visitors together: for example 5 sign-in attempts per visitor every 5 minutes, or 2,000 calls an hour to an expensive AI endpoint. Rate limits need a paid plan, and an app can have up to 5 of them.
Ask your assistant in plain words, for example "limit sign-in attempts to 5 per visitor every 5 minutes" or "allow at most 60 page loads a minute per visitor under /plan/". It writes the rules into static/__dev/firewall.json, and the next publish makes them live. The Rate limits card in Services → Firewall lists the rules and says whether they are live or not published yet.
- Path
- An exact path (
/_api/auth/login), or one ending in*for every path that starts with it (/_api/ai/*,/*). An endpoint's path is/_api/followed by its name. - Method
- GET, POST, or both (the default).
- Limit and window
- At most this many requests per window. A window can be 1 second to 1 day. Windows start at fixed times rather than sliding, so a caller can get up to twice the limit across the end of one window and the start of the next.
- Count by
- Each visitor's IP address on its own, or all visitors together. People behind one network, like a school or an office, share one count per visitor.
A request over the limit gets a 429 answer with a retry-after header. A call to your API gets JSON with the code floot_rate_limited, and a page gets a short Too many requests page. A visitor over a per-visitor limit is refused on that rule's paths until the window ends. One who keeps going is also refused at Floot's CDN for 15 minutes, twice as long each time it happens again (never past the end of the window). That block covers cached pages and files too.
What rate limits count
- Only requests that reach your app's backend are counted: calls to
/_api/...and server-rendered pages not served from the cache. Static files, cached pages and the pages of an app without server rendering never reach it, so they are not counted. - A limit for all visitors together is never enforced at the CDN, only by your app's backend.
- Refused requests still use a little of your hosting compute, because your backend answers them. A real flood is stopped earlier, by the protection every app gets.
- On the free plan, a publish leaves the rules off, and they switch off by themselves if the project's plan is downgraded. The project's plan is the one that counts (the team's, for a team project), not the plan of the person publishing.
- A file with errors changes nothing: the published app keeps the rules it has, and the card lists the errors.
Record where your app's traffic comes from
When traffic or hosting costs jump, turn on Record where this app's traffic comes from in the Traffic log card. It records every request to your published app for 72 hours or 5 million requests, whichever comes first, then turns itself off. The card shows:
- Total requests, the share that came from bots, and the requests refused at the edge
- The top IP addresses (with their network and country), networks, countries, paths and user agents
From a path that gets too many requests, click Limit this path to ask your assistant for a rate limit on it. The summary updates every few minutes.
- Paid plans only. Anyone who can publish the project can start it, and Stop now always works.
- Recording changes nothing for visitors: the same firewall rules apply.
- Recorded requests are kept 7 days, then deleted. They include your visitors' IP addresses (see How long Floot keeps things).
- It sees requests, not answers, so it can't show status codes or how much data each visitor downloaded. Some requests have no network on record, so the networks list under-counts.
On a branch
On a branch, these settings apply to the branch's own published address only. A merge doesn't carry them: set the live app's on main.