|
|
@ -19,6 +19,8 @@ import ( |
|
|
|
|
|
|
|
const maxCompletedSessions = 100 |
|
|
|
|
|
|
|
var ActiveConnections *int64 |
|
|
|
|
|
|
|
var ( |
|
|
|
StatsAddr = "localhost:6001" |
|
|
|
StatsPath = "/stats/session/plain" |
|
|
@ -84,7 +86,7 @@ func (s *simpleSessionStater) Start() error { |
|
|
|
}</style><title>Go-tun2socks Sessions</title></head>`) |
|
|
|
_, _ = fmt.Fprintf(w, "<h2>Go-tun2socks %s</h2>", StatsVersion) |
|
|
|
_, _ = fmt.Fprintf(w, "<h3>Now: %s ; Uptime: %s</h3>", now(), uptime()) |
|
|
|
_, _ = fmt.Fprintf(w, "<p>Active sessions %d</p>", len(sessions)) |
|
|
|
_, _ = fmt.Fprintf(w, "<p>Active sessions %d (%d)</p>", len(sessions), atomic.LoadInt64(ActiveConnections)) |
|
|
|
tablePrint(w, sessions) |
|
|
|
_, _ = fmt.Fprintf(w, "<br/><br/>") |
|
|
|
_, _ = fmt.Fprintf(w, "<p>Recently completed sessions %d</p>", len(s.completedSessions)) |
|
|
|