diff --git a/README.md b/README.md index 471b603..c5f7f04 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ When Newt receives WireGuard control messages, it will use the information encod - `secret`: A unique secret (not shared and kept private) used to authenticate the client ID with the websocket in order to receive commands. - `dns`: DNS server to use to resolve the endpoint - `log-level` (optional): The log level to use. Default: INFO - +- `updown` (optional): A script to be called when targets are added or removed. + Example: ```bash @@ -92,6 +93,18 @@ WantedBy=multi-user.target Make sure to `mv ./newt /usr/local/bin/newt`! +### Updown + +You can pass in a updown script for Newt to call when it is adding or removing a target: + +`--updown "python3 test.py"` + +It will get called with args when a target is added: +`python3 test.py add tcp localhost:8556` +`python3 test.py remove tcp localhost:8556` + +Returning a string from the script in the format of a target (`ip:dst` so `10.0.0.1:8080`) it will override the target and use this value instead to proxy. + ## Build ### Container