Github Realtime Relay
Receive all Github events in realtime with socket.io from the Github Realtime Relay. This is probably the simplest way to create a realtime application on top of Github.
Server (Node)
Install the socket.io-client from npm.
npm install socket.io-client
To receive all events you can hook onto the /events
namespace
and subscribe to a specific Github Event. Please use lower case for subscribing to the event types.
var url = 'http://ghrr.lukasmartinelli.ch:80/events';var socket = url; socket;
There is also a /statistics
namespace used by the GHRR web interface that
sends usage statistics for the Event Types.
var url = 'http://ghrr.lukasmartinelli.ch:80';var io = url;
Web Application
You need to add the socket.io-client to your web application.
You can now connect directly to the public websocket. We support CORS for all domains so you should not encounter any problems.
var url = 'ghrr.lukasmartinelli.ch:80/events';var socket = ; socket;
Host it yourself
Install with npm.
npm install ghrr
In order to poll all events you need an OAUTH access token.
Run the github realtime relay with a poll rate of 1000
and on port 80
.
npm install ghrrnpm run start "YOUR GITHUB ACCESS TOKEN" 1000 80
Now you can visit the status page displaying live statistics.