Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deepstreamio-server-client-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deepstreamio-server-client-plugin

A plugin to expose a deepstream client on the server

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

deepstreamio-server-client-plugin

NPM version Build Status Coveralls Status Dependency Status Downloads

A plugin to expose a deepstream client on the server

Install

npm i -D deepstreamio-server-client-plugin

Usage

const server = /* create deepstream server */;
import clientPlugin, { extendPermissionHandler } from "deepstreamio-server-client-plugin"

// Attach to server
const port = 6021; // Your server's TCP port
const bytes = 64; // More bytes = more secure but slower
clientPlugin(server, port, bytes);

// extendPermissionHandler handles authenticating the server for you, and then
// defers to your permissionHandler
server.set('permissionHandler', extendPermissionHandler({
	isValidUser: function(conn, auth, cb) {
		// Handle client auth
	},
	canPerformAction: function(username, message, cb) {
		// Handle client permissions
	}
}));

// Wait for "clientReady" before you try to use the client
// "clientReady" won't fire until the server starts
server.once('clientReady', () => {
	// Use client
});

Developing

This project uses the RISE yeoman generator. For development workflow, see the workflow guide. Cheatsheet:

  • Add code to src/index.js and tests to test/index.js.
  • Lint, build and test a project with npm run build.
  • Build and watch changes in src/ with npm run watch
  • Run only tests with npm run test.
  • Check coverage with npm run coverage.
  • Generate a TOC for the CHANGELOG with npm run toc
  • Deploy to a remote origin with npm run deploy.
  • Bump version and publish a package with npm run major or minor/patch

License

MIT © Chris Morrell

Keywords

FAQs

Package last updated on 12 Feb 2016

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