|
@@ -1,15 +1,14 @@
|
|
|
-#Server-Sent Events [](https://godoc.org/github.com/manucorporat/sse) [](https://travis-ci.org/manucorporat/sse)
|
|
|
|
|
|
|
+#Server-Sent Events [](https://godoc.org/github.com/gin-contrib/sse) [](https://travis-ci.org/gin-contrib/sse)
|
|
|
|
|
|
|
|
Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is [standardized as part of HTML5[1] by the W3C](http://www.w3.org/TR/2009/WD-eventsource-20091029/).
|
|
Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is [standardized as part of HTML5[1] by the W3C](http://www.w3.org/TR/2009/WD-eventsource-20091029/).
|
|
|
|
|
|
|
|
-- [Real world demostration using Gin](http://sse.getgin.io/)
|
|
|
|
|
- [Read this great SSE introduction by the HTML5Rocks guys](http://www.html5rocks.com/en/tutorials/eventsource/basics/)
|
|
- [Read this great SSE introduction by the HTML5Rocks guys](http://www.html5rocks.com/en/tutorials/eventsource/basics/)
|
|
|
- [Browser support](http://caniuse.com/#feat=eventsource)
|
|
- [Browser support](http://caniuse.com/#feat=eventsource)
|
|
|
|
|
|
|
|
##Sample code
|
|
##Sample code
|
|
|
|
|
|
|
|
```go
|
|
```go
|
|
|
-import "github.com/manucorporat/sse"
|
|
|
|
|
|
|
+import "github.com/gin-contrib/sse"
|
|
|
|
|
|
|
|
func httpHandler(w http.ResponseWriter, req *http.Request) {
|
|
func httpHandler(w http.ResponseWriter, req *http.Request) {
|
|
|
// data can be a primitive like a string, an integer or a float
|
|
// data can be a primitive like a string, an integer or a float
|
|
@@ -51,4 +50,4 @@ text/event-stream
|
|
|
|
|
|
|
|
##Decoding support
|
|
##Decoding support
|
|
|
|
|
|
|
|
-There is a client-side implementation of SSE coming soon.
|
|
|
|
|
|
|
+There is a client-side implementation of SSE coming soon.
|