I have a web application that needs to keep writing (possibly never ending) tohttp.ResponseWriter
, and to display those output to html page. It's something like:
func handler(w http.ResponseWriter, req *http.Request) {
switch req.Method {
case "GET":
for {
fmt.Fprintln(w, "repeating...")
}
}
}
I feel like the HTML output does not catch up fast enough.
If I want to keep writing on http.ResponseWriter
and display those on HTML as fast as possible in realtime, what would be the best way to achieve this?
Thanks,