From b5ca22cd7d18fcbfe98d21024b0cccd0c7d9767d Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Mon, 17 Jul 2023 10:11:26 -0700 Subject: [PATCH] Implent SSE feed --- main.go | 2 +- static/index.html | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 7420502..780c178 100644 --- a/main.go +++ b/main.go @@ -48,7 +48,7 @@ func generateCounter() handler { case <-ctx.Done(): break outer case <-tick: - fmt.Fprintf(w, "event: count\ndata: %d\n\n", i) + fmt.Fprintf(w, "event: count\ndata:
%d
\n\n", i) w.(http.Flusher).Flush() } } diff --git a/static/index.html b/static/index.html index d9c8890..5625853 100644 --- a/static/index.html +++ b/static/index.html @@ -7,8 +7,7 @@ -
-
+