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
Wireproxy supports exposing a health endpoint for monitoring purposes.
196
+
The argument `--info/-i` specifies an address and port (e.g. `localhost:9080`), which exposes a HTTP server that provides health status metric of the server.
197
+
198
+
Currently two endpoints are implemented:
199
+
200
+
`/metrics`: Exposes information of the wireguard daemon, this provides the same information you would get with `wg show`. [This](https://www.wireguard.com/xplatform/#example-dialog) shows an example of what the response would look like.
201
+
202
+
`/readyz`: This responds with a json which shows the last time a pong is received from an IP specified with `CheckAlive`. When `CheckAlive` is set, a ping is sent out to addresses in `CheckAlive` per `CheckAliveInterval` seconds (defaults to 5) via wireguard. If a pong has not been received from one of the addresses within the last `CheckAliveInterval` seconds (+2 seconds for some leeway to account for latency), then it would respond with a 503, otherwise a 200.
203
+
204
+
For example:
205
+
```
206
+
[Interface]
207
+
PrivateKey = censored
208
+
Address = 10.2.0.2/32
209
+
DNS = 10.2.0.1
210
+
CheckAlive = 1.1.1.1, 3.3.3.3
211
+
CheckAliveInterval = 3
212
+
213
+
[Peer]
214
+
PublicKey = censored
215
+
AllowedIPs = 0.0.0.0/0
216
+
Endpoint = 149.34.244.174:51820
217
+
218
+
[Socks5]
219
+
BindAddress = 127.0.0.1:25344
220
+
```
221
+
`/readyz` would respond with
222
+
```
223
+
< HTTP/1.1 503 Service Unavailable
224
+
< Date: Thu, 11 Apr 2024 00:54:59 GMT
225
+
< Content-Length: 35
226
+
< Content-Type: text/plain; charset=utf-8
227
+
<
228
+
{"1.1.1.1":1712796899,"3.3.3.3":0}
229
+
```
230
+
231
+
And for:
232
+
```
233
+
[Interface]
234
+
PrivateKey = censored
235
+
Address = 10.2.0.2/32
236
+
DNS = 10.2.0.1
237
+
CheckAlive = 1.1.1.1
238
+
```
239
+
`/readyz` would respond with
240
+
```
241
+
< HTTP/1.1 200 OK
242
+
< Date: Thu, 11 Apr 2024 00:56:21 GMT
243
+
< Content-Length: 23
244
+
< Content-Type: text/plain; charset=utf-8
245
+
<
246
+
{"1.1.1.1":1712796979}
247
+
```
248
+
249
+
If nothing is set for `CheckAlive`, an empty JSON object with 200 will be the response.
250
+
251
+
The peer which the ICMP ping packet is routed to depends on the `AllowedIPs` set for each peers.
191
252
192
253
# Stargazers over time
193
254
[](https://starchart.cc/octeep/wireproxy)
0 commit comments