Socket
Socket
Sign inDemoInstall

npush

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npush

n:push Real Time Messaging System by Newicon Ltd.


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

REQUIREMENTS for NPush Module

  1. MongoDB

    Default mongo installation and you need to create dedicated schema:

    1.1 Accounts collection

     Name of collection: accounts
     Single document schema per client/user:
     { 
     	"apps" : [ 
     			{ "apis" : [ 
     					{ "name" : "api 1",
     					  "id" : ObjectId( "50ae010ab19160bb1d010000" ) 
     					},
     					{ "name" : "api 2",
     					  "id" : ObjectId( "50ae010ab19160bb1d010001" ) 
     					} 
     				],
     			  "application_id" : "1",
     			  "dscr" : "first application",
     			  "id" : ObjectId( "50ae0106b19160bb1d000000" ),
     			  "name" : "application 1" 
     			},
     			{ "apis" : [ 
     					{ "name" : "api 1",
     					  "id" : ObjectId( "50ae010ab19160bb1d010002" ) 
     					},
     					{ "name" : "api 2",
     					  "id" : ObjectId( "50ae010ab19160bb1d010003" ) 
     					} 
     				],
     			  "application_id" : "2",
     			  "dscr" : "second application",
     			  "id" : ObjectId( "50ae0106b19160bb1d000001" ),
     			  "name" : "application 2" 
     			} 
     		],
     	"client_room" : "localhost",
     	"dscr" : "localhost",
     	"name" : "localhost",
     	"password" : "localhost",
     	"username" : "localhost" 
     }
    

    1.2 APIs collection

     Name of collection: apis
     Single document schema per api:
     { 
     	"enabled" : "true",
     	"key" : "50ae010ab19160bb1d010000",
     	"client" : "50adfdfeb19160a41d000000",
     	"time" : 1355310922 
     }
    

    1.3 Also you have to pass mongodb setting to the worker instance:

    { 'MongoDB' : { 'url' : "user:pass@localhost:27017/ni_sockets", 'collections' : ["accounts", "apis"] }, }

    To manage clients, application and apis it is highly recommended to use "npush-admin" project.

  2. RedisServer

    Default installation. If you want to use own PORT and HOST address then pass this settings to worker instance:

    { 'RedisServer' : { 'redisClient' : { 'port' : 6379, 'host' : 'localhost'} }, }

  3. Example

    To run example you need mongoDB with right schema and Redis working.

    Steps:

    1. Copy example folder outside npush module
    2. Go to the folder
    3. $ npm install
    4. $ node npush-s.js 8080 4

    Have fun!

Keywords

FAQs

Package last updated on 08 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc