Skip to content

johannesboyne/sse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Server-Side Event Framework

Inspired by bootic, thus all credits are directed there bootic / broker.go.

Simple to use

// setup
sseBroker := sse.NewBroker()
// simply add a handler
http.Handle("/events", sseBroker)
log.Fatal(http.ListenAndServe(":8080", nil))
// alternative
// log.Fatal(http.ListenAndServe(":8080", sseBroker))

// somewhere else
// write to the notification channel
sseBroker.Notifier <- []byte(sampleJson)
// => gets propagated to all connected clients
// clients are identified with ULIDs

License: MIT

About

Simple Server-Side Events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages