You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-1Lines changed: 16 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,8 @@ When Newt receives WireGuard control messages, it will use the information encod
36
36
-`secret`: A unique secret (not shared and kept private) used to authenticate the client ID with the websocket in order to receive commands.
37
37
-`dns`: DNS server to use to resolve the endpoint
38
38
-`log-level` (optional): The log level to use. Default: INFO
39
-
39
+
-`updown` (optional): A script to be called when targets are added or removed.
40
+
40
41
Example:
41
42
42
43
```bash
@@ -92,6 +93,20 @@ WantedBy=multi-user.target
92
93
93
94
Make sure to `mv ./newt /usr/local/bin/newt`!
94
95
96
+
### Updown
97
+
98
+
You can pass in a updown script for Newt to call when it is adding or removing a target:
99
+
100
+
`--updown "python3 test.py"`
101
+
102
+
It will get called with args when a target is added:
103
+
`python3 test.py add tcp localhost:8556`
104
+
`python3 test.py remove tcp localhost:8556`
105
+
106
+
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.
107
+
108
+
You can look at updown.py as a reference script to get started!
0 commit comments