RelayR is a Go package that provides easy-to-use real time communication APIs for Go web applications.
Please see CHANGELOG.md for details about the changes between versions.
RelayR relies on the Gorilla WebSocket package for WebSocket support. Please head over to that repository, give it a star, and ``go getit into your
GOPATH`.
RelayR itself however, will fall back to Long Polling for any browsers that do not support Web Sockets (you just need the above package so that your server supports Web Sockets).
After you have installed the Gorilla WebSocket package, you can run the following:
go get -u github.com/simon-whitehead/relayr
The /examples
directory contains three examples.
The first one is a simple Server -> Client timestamp push. The server will push the current time down to all connected clients every second.
It looks like this:
The second one is a replica of the famous SignalR sample, "High-Frequency Realtime with SignalR" where a shape can be dragged around a browser and broadcast to all clients.
It looks like this:
The third one demonstrates Groups and membership. It allows clients to subscribe to groups and receive notifications that are pushed to groups they are subscribed to.
This is very much a work in progress - some might say, pre-alpha. The code is horrible .. but it works. I am opening it up to the world early for feedback and contributions (in any form).
Please! Fork away .. improve it .. create a PR .. whatever you want to do. I am open to any and all help.
This code is released under the Apache 2.0 licence.