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
feat: add client version tracking to server status endpoint (#151)
- Added client version information to the wstunnel server's `/_stats` endpoint
- Client now sends its version as an HTTP header during WebSocket connection establishment
- Server stores and displays the client version for each connected tunnel
- Modified `main.go` to properly propagate version string to tunnel package using `SetVV(VV)`
- Updated `connection_handler.go` to send client version as `X-Client-Version` header
- Enhanced `ws.go` to extract and store client version from the header
- Updated `wstunsrv.go` to display client version in the stats output
- Added documentation for the `/_stats` endpoint in README.md
- [x] All existing tests pass with `make test`
- [x] Linting passes with `make lint`
- [x] Client version appears in `/_stats` endpoint output when accessed from localhost
- [x] Version command now outputs actual version string instead of "dummy"
Closes#142
Copy file name to clipboardExpand all lines: README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,6 +232,38 @@ server {
232
232
}
233
233
````
234
234
235
+
### Monitoring and Status Endpoint
236
+
237
+
WStunnel server provides a `/_stats` endpoint that displays information about connected tunnels. When accessed from localhost, it provides detailed information including:
238
+
239
+
- Number of active tunnels
240
+
- Token information for each tunnel
241
+
- Pending requests per tunnel
242
+
- Client IP address and reverse DNS lookup
243
+
- Client version information
244
+
- Idle time for each tunnel
245
+
246
+
Example output:
247
+
248
+
```text
249
+
tunnels=2
250
+
251
+
tunnel00_token=my_token_...
252
+
tunnel00_req_pending=0
253
+
tunnel00_tun_addr=192.168.1.100:54321
254
+
tunnel00_tun_dns=client.example.com
255
+
tunnel00_client_version=wstunnel dev - 2025-05-27 18:59:20 - cli-version
256
+
tunnel00_idle_secs=5.2
257
+
258
+
tunnel01_token=another_t...
259
+
tunnel01_req_pending=1
260
+
tunnel01_tun_addr=10.0.0.5:12345
261
+
tunnel01_client_version=wstunnel v1.0.0
262
+
tunnel01_idle_secs=120.5
263
+
```
264
+
265
+
Note: Full statistics are only available when the endpoint is accessed from localhost. Remote requests will only see the total number of tunnels.
0 commit comments