Spanish Total.js
English
Documentation For AI agents
Contents

Change the traffic with rules

A rule does something with the requests that fit it, each time they go through. It can pause them, answer them with a file or send them to another server.

.md GitHub
On this page

Rules work with plain HTTP, and with the HTTPS of the domains that you read. They cannot touch the rest.

Make a rule

The easiest way is from a request: right-click it and choose Pause it next time…, Answer it with a file… or Send it to another server… The rule opens with its address written.

To start from nothing, press the button Rules at the top, or ⌘R on the Mac and Ctrl+R on Windows and Linux, and then New rule. Fill it in and press Keep the rule.

What it does

ChoiceIts page
Pause it, to change itPause a request or its answer
Answer with a file of this computerAnswer with a file
Send it to another serverSend requests to another server

Which requests it fits

In Addresses, * stands for anything:

WriteIt fits
api.example.comEvery address of that host
api.example.com/usersThat address and no other
api.example.com/users*The same with anything after it, such as ?page=2 or /7
https://*.example.com/*Only HTTPS, in the names under example.com
localhost:8000/*That host and port

The query counts. A rule made from a request that had one ends in ?*, so it fits the same address with any query. Change the end to * to fit it without a query too.

Method limits the rule to one method. Any method fits all.

When more than one fits

  • If any of them pauses, the request is paused.
  • If any answers with a file, the first of those answers, and the server is not asked.
  • If not, the first one that sends to another server does it.

The arrow of a rule moves it up.

Turn off, change and remove

The box at the start of a rule turns it on and off. The pencil changes it, and the bin removes it without asking. The bottom of the window says how many are on: rules stay when you quit, so look there if something answers in a strange way.

Made in Europe