Skip to content

Instantly share code, notes, and snippets.

@fiorix
fiorix / sse.go
Last active June 27, 2024 02:15
Go and Server Sent Events for HTTP/1.1 and HTTP/2.0
// Go and Server Sent Events for HTTP/1.1 and HTTP/2.0
//go:generate go run $GOROOT/src/crypto/tls/generate_cert.go -host localhost
package main
import (
"fmt"
"io"
"log"
"net/http"