node-red-contrib-websocket-server 0.0.3

websocket test with websocket open/close event information

npm install node-red-contrib-websocket-server

Node-red Apache2 Websocket

node-red-contrib-websocket-server

Node for run Websocket server with some aditional features

Core

Based on Node-Red inbuild websocket node

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

    npm install node-red-contrib-websocket-server

Nodes

Websocket_server

Settings:

  • Path - Websocket server address

    ws(s)://<your node-red address>:<node-red Port>/"Path"

  • Send/Receive - msg format

    • payload - only msg.paylod will be processed
    • Entire message - full msg object will be processed
  • Ping action

    • none - Automatically answer on Ping request from Client
    • Send ping - Server send ping every x seconds (require "Send ping interval" option >0)
    • Receive ping - Server is waiting for incoming ping from Client. If interval between two ping requests is greater than x seconds (require "Receive ping timeout" option >0) connection will be closed by server.

Websocket_in - node for receive websocket messages

  • Path - You can connect it to already existing server Path or create new server
  • Name - Optional Node Name

Websocket_out - node for send websocket messages

  • Path - You can connect it to already existing server Path or create new server
  • Name - Optional Node Name

Websocket_Open/Close - Information node about connection status

  • Path - You can connect it to already existing server Path or create new server
  • Name - Optional Node Name

    Output - {msg.event : open or close, msg._session : {id : websocket id, type : 'websocket'}}

Websocket_Drop - node to forcefully close websocket by id

  • Path - You can connect it to already existing server Path or create new server
  • Name - Optional Node Name

    Input - require msg object with ._session.id

TODO

  • Clean code
  • Add tips in nodes
  • In Websocket_Open/Close add reason for close event

Node Info

Version: 0.0.3
Updated 1 week, 1 day ago
License: ISC
Rating: not yet rated

Categories

Actions

Rate:

Downloads

0 in the last week

Nodes

  • websocket_Open/Close
  • websocket_Drop
  • websocket_in
  • websocket_out
  • websocket_server

Keywords

  • websocket
  • open/close
  • server
  • node-red

Maintainers