API
A way for another program, a client app or a server panel, to read and control a running Apranik. Each API is a module with its own listener. This build has one: the Clash API.
Structure
json
{
"apis": [
{
"type": "clash",
"settings": {
"listen": "127.0.0.1",
"port": 9090,
"secret": "a long random string"
}
}
]
}Fields
type
stringRequired
The API module: clash.
settings
object
The module's settings, address and secret included.
Lifecycle
apranik runstarts the APIs last, after the inbounds are up, and closes them first. If one cannot start, for example its port is taken,runstops.apranik checknever starts an API, so a taken port shows only atrun.- An API can see where users go and can change users. Give it a long secret and a loopback address.