Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. 'use strict';
  2.  
  3. import { randomBytes } from 'crypto';
  4. import Client from 'deepstream.io-client-js';
  5.  
  6. export default function(server, port = 6021, bytes = 256) {
  7. const username = '__superadmin__';
  8. const password = randomBytes(bytes).toString('hex');
  9.  
  10. server.once('started', () => {
  11. server.client = Client(`localhost:${port}`).login({
  12. username,
  13. password
  14. });
  15. });
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement