Skip to content

Instantly share code, notes, and snippets.

@inxilpro
Last active February 12, 2016 19:09
Show Gist options
  • Select an option

  • Save inxilpro/1c574e82ceae543a40a2 to your computer and use it in GitHub Desktop.

Select an option

Save inxilpro/1c574e82ceae543a40a2 to your computer and use it in GitHub Desktop.
'use strict';
import { randomBytes } from 'crypto';
import Client from 'deepstream.io-client-js';
export default function(server, port = 6021, bytes = 256) {
const username = '__superadmin__';
const password = randomBytes(bytes).toString('hex');
server.once('started', () => {
server.client = Client(`localhost:${port}`).login({
username,
password
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment