mirror of
https://github.com/fosrl/newt.git
synced 2026-02-07 21:46:39 +00:00
Add documentation for updown
This commit is contained in:
15
README.md
15
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.
|
- `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
|
- `dns`: DNS server to use to resolve the endpoint
|
||||||
- `log-level` (optional): The log level to use. Default: INFO
|
- `log-level` (optional): The log level to use. Default: INFO
|
||||||
|
- `updown` (optional): A script to be called when targets are added or removed.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -92,6 +93,18 @@ WantedBy=multi-user.target
|
|||||||
|
|
||||||
Make sure to `mv ./newt /usr/local/bin/newt`!
|
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
|
## Build
|
||||||
|
|
||||||
### Container
|
### Container
|
||||||
|
|||||||
Reference in New Issue
Block a user