sugo-client-auth
v2.0.1
Published
Authorize sugo-client
Downloads
26
Readme
sugo-client-auth
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.