Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ghrr

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghrr

Github Realtime Relay

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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 = require('socket.io-client')(url);

socket.on('pushevent', function(event){
   console.log('Push: ' + event.repository.full_name);
});

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 = require('socket.io-client')(url);
io('/statistics').on('types', function(typeCounts) {
    console.log('PushEvents: ' + typeCounts.pushevent);
}

Web Application

You need to add the socket.io-client to your web application.

<script src="//cdn.jsdelivr.net/socket.io-client/1.2.0/socket.io.js"></script>

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 = io(url);

socket.on('pushevent', function (event) {
   console.log('Push: ' + event.repository.full_name);
});

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 ghrr
npm run start "YOUR GITHUB ACCESS TOKEN" 1000 80

Now you can visit the status page displaying live statistics.

Screenshot of Github Realtime Relay

Keywords

FAQs

Package last updated on 24 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc