2.0.1 • Published 7 years ago

sugo-client-auth v2.0.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

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

SignatureDescription
authorize(socket, auth) -> PromiseAuthorize socket

License

This software is released under the Apache-2.0 License.

Links