1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

add examples for websocket in/out node

This commit is contained in:
Hiroyasu Nishiyama 2021-02-03 17:13:56 +09:00
parent 3cc6c4433f
commit 818021e0b7
2 changed files with 192 additions and 0 deletions

View File

@ -0,0 +1,96 @@
[
{
"id": "13410716.69c9d9",
"type": "websocket in",
"z": "a8360b47.074ec8",
"name": "",
"server": "89db22b6.9aa36",
"client": "",
"x": 280,
"y": 180,
"wires": [
[
"c2541f10.59544"
]
]
},
{
"id": "c2541f10.59544",
"type": "debug",
"z": "a8360b47.074ec8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 430,
"y": 180,
"wires": []
},
{
"id": "6788839e.04576c",
"type": "inject",
"z": "a8360b47.074ec8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Hello, World!",
"payloadType": "str",
"x": 290,
"y": 120,
"wires": [
[
"438c232a.06c2cc"
]
]
},
{
"id": "438c232a.06c2cc",
"type": "websocket out",
"z": "a8360b47.074ec8",
"name": "",
"server": "",
"client": "63620788.bda128",
"x": 500,
"y": 120,
"wires": []
},
{
"id": "c88f97a9.4410f8",
"type": "comment",
"z": "a8360b47.074ec8",
"name": "Connect to websocket in server",
"info": "`websocket out` node can connect to web socket server. `websocket in` node can serve a web socket server.\n",
"x": 290,
"y": 80,
"wires": []
},
{
"id": "89db22b6.9aa36",
"type": "websocket-listener",
"path": "/ws1",
"wholemsg": "false"
},
{
"id": "63620788.bda128",
"type": "websocket-client",
"path": "ws://localhost:1880/ws1",
"tls": "",
"wholemsg": "false"
}
]

View File

@ -0,0 +1,96 @@
[
{
"id": "759c0b2b.8a0484",
"type": "websocket in",
"z": "a8360b47.074ec8",
"name": "",
"server": "",
"client": "1d80bd86.93f372",
"x": 340,
"y": 520,
"wires": [
[
"1f7a7454.cb65ec"
]
]
},
{
"id": "1f7a7454.cb65ec",
"type": "debug",
"z": "a8360b47.074ec8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 550,
"y": 520,
"wires": []
},
{
"id": "aa2fe781.e92b28",
"type": "inject",
"z": "a8360b47.074ec8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Goodbye, World!",
"payloadType": "str",
"x": 300,
"y": 460,
"wires": [
[
"f8bdbc9b.d82dd"
]
]
},
{
"id": "f8bdbc9b.d82dd",
"type": "websocket out",
"z": "a8360b47.074ec8",
"name": "",
"server": "40bd4295.3e4ecc",
"client": "",
"x": 460,
"y": 460,
"wires": []
},
{
"id": "c3fbc602.2e7f08",
"type": "comment",
"z": "a8360b47.074ec8",
"name": "Connect to websocket out server",
"info": "`websocket out` node can connect to web socket server. `websocket in` node can serve a web socket server.\n",
"x": 290,
"y": 420,
"wires": []
},
{
"id": "1d80bd86.93f372",
"type": "websocket-client",
"path": "ws://localhost:1880/ws2",
"tls": "",
"wholemsg": "false"
},
{
"id": "40bd4295.3e4ecc",
"type": "websocket-listener",
"path": "/ws2",
"wholemsg": "false"
}
]