node-red-contrib-websocket-server 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +61 -0
  2. package/package.json +5 -5
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+
2
+
3
+ [![Node-red](https://img.shields.io/badge/Platform-Node--Red-red?style=for-the-badge
4
+ )](https://nodered.org/)
5
+ [![Apache2](https://img.shields.io/badge/License-Apache--2.0-brightgreen?style=for-the-badge
6
+ )](https://www.apache.org/licenses/LICENSE-2.0)
7
+ [![Websocket](https://img.shields.io/badge/Protocol-Websocket-darkgreen?style=for-the-badge
8
+ )](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
9
+
10
+ # node-red-contrib-websocket-server
11
+ Node for run Websocket server with some aditional features
12
+
13
+ ## Core
14
+ Based on Node-Red inbuild websocket node
15
+
16
+ ## Install
17
+ Run the following command in your Node-RED user directory - typically `~/.node-red`
18
+ ```bash
19
+ npm install node-red-contrib-websocket-server
20
+ ```
21
+
22
+ ## Nodes
23
+
24
+ #### Websocket_server
25
+ Settings:
26
+ - Path - Websocket server address
27
+
28
+ `ws(s)://<your node-red address>:<node-red Port>/"Path"`
29
+
30
+ - Send/Receive - msg format
31
+ - payload - only msg.paylod will be processed
32
+ - Entire message - full msg object will be processed
33
+
34
+ - Ping action
35
+ - none - Automatically answer on Ping request from Client
36
+ - Send ping - Server send ping every x seconds (require "Send ping interval" option >0)
37
+ - 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.
38
+
39
+ #### Websocket_in - node for receive websocket messages
40
+ - Path - You can connect it to already existing server Path or create new server
41
+ - Name - Optional Node Name
42
+ #### Websocket_out - node for send websocket messages
43
+ - Path - You can connect it to already existing server Path or create new server
44
+ - Name - Optional Node Name
45
+ #### Websocket_Open/Close - Information node about connection status
46
+ - Path - You can connect it to already existing server Path or create new server
47
+ - Name - Optional Node Name
48
+ #### Output - `{msg.event : open or close, msg._session : {id : websocket id, type : 'websocket'}}`
49
+
50
+ #### Websocket_Drop - node to forcefully close websocket by id
51
+ - Path - You can connect it to already existing server Path or create new server
52
+ - Name - Optional Node Name
53
+ #### Input - require msg object with `._session.id`
54
+
55
+ ## TODO
56
+ - Clean code
57
+ - Add tips in nodes
58
+ - In Websocket_Open/Close add reason for close event
59
+
60
+
61
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-websocket-server",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "websocket test with websocket open/close event information",
5
5
  "keywords": [
6
6
  "websocket",
@@ -17,9 +17,9 @@
17
17
  "scripts": {
18
18
  "test": "echo \"Error: no test specified\" && exit 1"
19
19
  },
20
- "node-red" : {
21
- "nodes": {
22
- "websockets": "websocket.js"
23
- }
20
+ "node-red": {
21
+ "nodes": {
22
+ "websockets": "websocket.js"
23
+ }
24
24
  }
25
25
  }