sbx-socket-gateway

2.0.7 • Public • Published

sbx-server-service

sbx-socket-gateway module

Requirements

  • node >= 10
  • sbx >=0.9.1

Peer dependencies

"geoip-lite": "^1.4.2",
"jsonwebtoken": "^8.5.1",
"lodash": "^4.17.20",
"sbx-rest-gateway": "0.0.4",
"socket.io": "^2.3.0"

Installation

$ npm install sbx-socket-gateway

Use package:

const { RestService }   = require('sbx-socket-gateway');

//Mixin to service

{
    mixins: [
            SocketService(broker, {
                events: {
                    'quote.tick.:symbol': {
                        name: 'Quotes stream',
                        // access: ['user'],
                        params: {
                            symbol: {type: 'string', optional: true},
                            bid: {type: 'number', optional: true},
                            ask: {type: 'number', optional: false},
                            volume: {type: 'number', optional: false}
                        },
                        room: 'quote.tick'
                    },
                    'quote.candle.:symbol': {
                        name: 'Candles stream',
                        params: {
                            symbol: {type: 'string', optional: true},
                            data: {type: 'array', optional: true}
                        },
                        room: 'quote.candle'
                    }
                }
            })      
    ]
}

Developers

  • Viktor Fischer

TODO

  • remove sbx-rest-gateway

License

Copyright (c) 2020 - 2021 Sobix Group LLC

Readme

Keywords

none

Package Sidebar

Install

npm i sbx-socket-gateway

Weekly Downloads

31

Version

2.0.7

License

none

Unpacked Size

30.6 kB

Total Files

14

Last publish

Collaborators

  • v.sobix