GitHub organization authorization for Socket.io.
This is useful for limiting Socket.io connections to members of a specific GitHub organization based on a GitHub token.
npm install socketio-github-org
Set as middleware for Socket.io:
const io = require("socket.io")(server)
const socketIOGithub = require("socketio-github-org")
io.use(socketIOGithub.authorize('Mygithuborganization'))
Append the GitHub token in the query string:
const socket = io.connect('http://localhost:9000', {
'query': 'token=' + github_token
})