Server configuration
config.toml, where the server keeps its files, and the CLI commands for tokens, relays, saved proxies and webhooks.
Where the files are
| System | Folder |
|---|---|
| Windows | %APPDATA%\Droidline |
| macOS | ~/Library/Application Support/Droidline |
| Linux | ~/.config/droidline |
DROIDLINE_HOME or --home <folder> chooses another folder, which lets one PC run separate servers. droidline doctor prints the folder in use.
| File | Written by | Holds |
|---|---|---|
config.toml | you | Ports, language, remote addresses, webhooks |
state.json | the server | Paired phones and hashed client tokens |
secrets.dpapi (Windows) or secrets.json | the server | Server key, TLS key, relay token, saved proxies, webhook secret |
tls.crt | the server | The certificate phones pin on the direct route |
config.toml
The server writes this file with comments on first start. Restart droidline serve after editing it.
name = "" # name phones show for this PC; empty means the computer name
lang = "" # error message language: en, ko or zh; empty means the system language
offline_wait = 30 # seconds a command waits for an offline phone
[agent]
listen = ":8779" # phones connect here
[client]
listen = "127.0.0.1:8780" # your code connects here
require_token = false # true: every connection, even local, needs a token
allowed_origins = [] # web pages allowed to call the HTTP API
[discovery]
listen = ":8778" # "off" disables Wi-Fi discovery
[pairing]
code = true # allow pairing by 6-digit code on the same Wi-Fi
[remote]
addresses = [] # e.g. "tls://203.0.113.5:8779", "wss://droid.example.com/agent"
[relay]
url = "" # set with droidline relay set
[[webhooks]]
url = "https://example.com/hooks/droidline"
package = "com.kakao.talk"
text_contains = ""
device = ""
Management commands
These change files in the server's folder; restart the server for relay changes.
droidline token create "build server" # prints a client token once
droidline token list
droidline token revoke <id>
droidline relay set <url> <token>
droidline relay status
droidline relay off
droidline proxy add kr1 socks5://user:pass@203.0.113.10:1080
droidline proxy list
droidline proxy remove kr1
droidline webhook secret
droidline rename <device> <name>
droidline revoke <device>
Running it as a service
droidline serve runs in the foreground and logs to standard error. To keep it running, use your system's service manager: a scheduled task at log-on or a service wrapper on Windows, a launchd agent on macOS, or a systemd user unit on Linux:
[Unit]
Description=Droidline server
[Service]
ExecStart=%h/.local/bin/droidline serve
Restart=on-failure
[Install]
WantedBy=default.target