implemented the pts feature in the server side as well

This commit is contained in:
2025-06-23 21:09:24 +09:00
parent d092540f08
commit 8331fdc1a2
11 changed files with 403 additions and 17 deletions

View File

@ -76,6 +76,7 @@ type json_out_server_stats struct {
ServerPeers int64 `json:"server-peers"`
SshProxySessions int64 `json:"pxy-ssh-sessions"`
ServerPtsSessions int64 `json:"server-pts-sessions"`
}
// this is a more specialized variant of json_in_notice
@ -911,6 +912,7 @@ func (ctl *server_ctl_stats) ServeHTTP(w http.ResponseWriter, req *http.Request)
stats.ServerRoutes = s.stats.routes.Load()
stats.ServerPeers = s.stats.peers.Load()
stats.SshProxySessions = s.stats.ssh_proxy_sessions.Load()
stats.ServerPtsSessions = s.stats.pts_sessions.Load()
status_code = WriteJsonRespHeader(w, http.StatusOK)
if err = je.Encode(stats); err != nil { goto oops }