diff --git a/api/index.html b/api/index.html
index 0e12986..ab3e9fa 100644
--- a/api/index.html
+++ b/api/index.html
@@ -112,6 +112,10 @@
Process ID |
- |
+
+ | WebSocket Connections |
+ - |
+
| Active Subscriptions |
- |
diff --git a/api/index.js b/api/index.js
index cfedeb5..9acd039 100644
--- a/api/index.js
+++ b/api/index.js
@@ -4492,6 +4492,9 @@ function updateStatsFromCpuMonitoringEvent(monitoringData) {
if (monitoringData.process_id !== undefined) {
updateStatsCell('process-id', monitoringData.process_id.toString());
}
+ if (monitoringData.active_connections !== undefined) {
+ updateStatsCell('websocket-connections', monitoringData.active_connections.toString());
+ }
if (monitoringData.memory_usage_mb !== undefined) {
updateStatsCell('memory-usage', monitoringData.memory_usage_mb.toFixed(1) + ' MB');
diff --git a/src/api.c b/src/api.c
index 427bf6e..1ad66d1 100644
--- a/src/api.c
+++ b/src/api.c
@@ -1291,6 +1291,10 @@ cJSON* query_cpu_metrics(void) {
pid_t pid = getpid();
cJSON_AddNumberToObject(cpu_stats, "process_id", (double)pid);
+ // Get active WebSocket connection count
+ extern int g_connection_count;
+ cJSON_AddNumberToObject(cpu_stats, "active_connections", (double)g_connection_count);
+
// Get memory usage from /proc/self/status
FILE* mem_stat = fopen("/proc/self/status", "r");
if (mem_stat) {
diff --git a/src/main.h b/src/main.h
index 552137b..3a4dd57 100644
--- a/src/main.h
+++ b/src/main.h
@@ -13,8 +13,8 @@
// Using CRELAY_ prefix to avoid conflicts with nostr_core_lib VERSION macros
#define CRELAY_VERSION_MAJOR 1
#define CRELAY_VERSION_MINOR 2
-#define CRELAY_VERSION_PATCH 44
-#define CRELAY_VERSION "v1.2.44"
+#define CRELAY_VERSION_PATCH 45
+#define CRELAY_VERSION "v1.2.45"
// Relay metadata (authoritative source for NIP-11 information)
#define RELAY_NAME "C-Relay"