Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including kuzzle-plugin-websocket with all npm packages installed. Try it out:

var kuzzlePluginWebsocket = require("kuzzle-plugin-websocket")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

kuzzle-plugin-websocket v1.0.10

Protocol plugin adding Websocket support to Kuzzle

Build Status codecov.io Dependency Status

Protocol plugin: websocket

Protocol plugin adding websocket support to Kuzzle.

Requires Kuzzle 1.0.0-RC8 or higher.

Manifest

This plugin doesn't need any right.

Configuration

You can override the configuration usign the CLI utilitie in Kuzzle:

NameDefault valueTypeDescription
port7513Integer > 1024Network port to open

How to use

Kuzzle may send a multitude of messages to a client, either to respond to multiple asynchronous requests, or to notify events on client's subscriptions.
To allow a client to link a response to a request or to a subscription, Kuzzle normally features a room system for protocols allowing it.

Since WebSocket messages do not support this feature natively, all messages sent through this protocol contain an additional room attribute at the root of the message structure. Clients connecting to Kuzzle using this protocol must use this field to dispatch incoming messages to the right parts of an application.

This room attribute is either:

  • a request requestId, for request responses
  • a channel (see Kuzzle subscriptions), for notifications on subscriptions

How to create a plugin

See Kuzzle documentation about plugin for more information about how to create your own plugin.

About Kuzzle

For UI and linked objects developers, Kuzzle is an open-source solution that handles all the data management (CRUD, real-time storage, search, high-level features, etc).

Kuzzle features are accessible through a secured API. It can be used through a large choice of protocols such as REST, Websocket or Message Queuing protocols.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free