summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authortoufic ar <contact@toufy.me>2026-02-05 22:19:32 +0200
committertoufic ar <contact@toufy.me>2026-02-05 22:19:32 +0200
commitb0786a03a9886e5b212da135432c5410de6305cb (patch)
tree3b8ae8316a7266cd71b04968441058a2d1efd311 /index.html
parent7f29a1f3155541f7e72c5ebfc5db8a030fd61a81 (diff)
downloadtor-snowflake-b0786a03a9886e5b212da135432c5410de6305cb.tar.gz
tor-snowflake-b0786a03a9886e5b212da135432c5410de6305cb.zip
add metrics
Diffstat (limited to 'index.html')
-rw-r--r--index.html35
1 files changed, 34 insertions, 1 deletions
diff --git a/index.html b/index.html
index eb71f91..2e77b2e 100644
--- a/index.html
+++ b/index.html
@@ -19,6 +19,7 @@
:root {
--background: #38383d;
--text: #ececec;
+ --text-alt: #868689;
--primary: #cc80ff;
--accent: #68b030;
::selection {
@@ -68,7 +69,20 @@
>adonis</a
>
runs a tor relay node and a snowflake proxy.<br />
- this helps people stay anonymous and circumvent censorship.
+ this helps people stay anonymous and circumvent censorship:<br />
+ <span
+ style="
+ color: var(--accent);
+ font-weight: bolder;
+ text-decoration: underline;
+ text-decoration-color: var(--accent);
+ "
+ id="snowflake_conns"
+ ></span>
+ <span style="color: var(--text-alt); font-weight: bolder"
+ >snowflake connections since last restart</span
+ >
+ <br />
</p>
</div>
@@ -95,4 +109,23 @@
></iframe>
</div>
</body>
+ <script>
+ async function fetchConnections() {
+ try {
+ const res = await fetch("https://tor.toufy.me/metrics.php", {
+ method: "GET",
+ headers: { Accept: "application/json" }
+ });
+ if (!res.ok) {
+ console.log(res);
+ snowflake_conns.innerHTML = 0;
+ return;
+ }
+ snowflake_conns.innerHTML = (await res.json()).snowflake_connections;
+ } catch (_) {
+ snowflake_conns.innerHTML = 0;
+ }
+ }
+ fetchConnections();
+ </script>
</html>