sugo-client-auth

2.0.1 • Public • Published

sugo-client-auth

Build Status npm Version JS Standard

Authorize sugo-client

Installation

$ npm install sugo-client-auth --save

Usage

'use strict'
 
const co = require('co')
const { authorize } = require('sugo-client-auth')
const sgSocketClient = require('sg-socket-client')
 
co(function * () {
  let socket = sgSocketClient('http://localhost:3000')
  yield socket.waitToConnect()
  yield authorize(socket, {
    token: 'mytoken'
  })
  /* ... */
  socket.disconnect()
  yield socket.waitToDisconnect()
}).catch((err) => console.error(err))
 

Functions

Available functions

Signature Description
authorize(socket, auth) -> Promise Authorize socket

License

This software is released under the Apache-2.0 License.

Links

Readme

Keywords

Package Sidebar

Install

npm i sugo-client-auth

Weekly Downloads

2

Version

2.0.1

License

Apache-2.0

Last publish

Collaborators

  • realglobe