Repository navigation
Description
Current Behavior
I have some flows in a tab that use two websocket client to connect to some backend outside nodered. (ws://host.docker.internal:3000/a)
The point is that even if the tab is totally disabled, the two websocket client config nodes, that are not used anywhere else, keep sending a kind of "alive" messages, exactly every 3 seconds (i could check by running sudo tcpdump -i any -nn 'port 3000')
I would expect that if the ws client config nodes were not used anywhere else, as long as the flows that do use them are totally disabled (at tab level) they would not try keep the connection alive. So not traffic should be generated at all
Regards!
Expected Behavior
Webscoket client config nodes should not try to keep alive the connection because they are not used in any active flow
Steps To Reproduce
Just use the flow
Example flow
A very simple and silly flow.
[
{
"id": "b58cd291736f1b1e",
"type": "inject",
"z": "e962aa0a5fb304bd",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "cmd_02",
"payloadType": "str",
"x": 710,
"y": 640,
"wires": [
[
"5745cb4e0f661dc1",
"f66e9b921987582a"
]
]
},
{
"id": "5745cb4e0f661dc1",
"type": "websocket out",
"z": "e962aa0a5fb304bd",
"name": "",
"server": "",
"client": "58399552e8d61305",
"x": 1070,
"y": 640,
"wires": []
},
{
"id": "e8071737b06f35b3",
"type": "websocket in",
"z": "e962aa0a5fb304bd",
"name": "",
"server": "",
"client": "58399552e8d61305",
"x": 800,
"y": 680,
"wires": [
[
"c05f3dd7b1f8be0a",
"ea51c436d5aab06f"
]
]
},
{
"id": "c05f3dd7b1f8be0a",
"type": "debug",
"z": "e962aa0a5fb304bd",
"name": "debug 62",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 680,
"wires": []
},
{
"id": "f66e9b921987582a",
"type": "change",
"z": "e962aa0a5fb304bd",
"name": "",
"rules": [
{
"t": "set",
"p": "wsCounter2",
"pt": "flow",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 880,
"y": 580,
"wires": [
[]
]
},
{
"id": "ea51c436d5aab06f",
"type": "change",
"z": "e962aa0a5fb304bd",
"name": "",
"rules": [
{
"t": "set",
"p": "wsCounter2",
"pt": "flow",
"to": "$flowContext(\"wsCounter2\") + 1",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1060,
"y": 760,
"wires": [
[]
]
},
{
"id": "b1dba5ddd2c57dc6",
"type": "inject",
"z": "e962aa0a5fb304bd",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 720,
"y": 740,
"wires": [
[
"f3e75adc70454d83"
]
]
},
{
"id": "f3e75adc70454d83",
"type": "change",
"z": "e962aa0a5fb304bd",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "wsCounter2",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 740,
"y": 780,
"wires": [
[
"c05f3dd7b1f8be0a"
]
]
},
{
"id": "58399552e8d61305",
"type": "websocket-client",
"path": "ws://host.docker.internal:3000/a",
"tls": "",
"wholemsg": "false",
"hb": "0",
"subprotocol": ""
}
]
Environment
- Node-RED version: 4.1.1
- Node.js version: v22.20.0
- npm version:
- Platform/OS: Ubunt 24.04 / Ubuntu 22.04
- Browser: Chrome
Activity
[-]Flow disabled but websocket client nodes keep connecting[/-][+]Flow disabled but websocket client config node keep connecting[/+]knolleary commentedon Mar 5, 2026
The
websocket-clientconfig node manages the outbound connection. Unlike the model used by the MQTT Broker node, it doesn't track users of the node, so will always try to connect.We need to update the node to track users to help decide if the connection is required or not.
Only connect websocket client if need to
bsense-rius commentedon Mar 7, 2026
Great job guys!
hardillb commentedon Mar 7, 2026
@bsense-rius we tend to leave issues open until the PRs have been merged and they ship in a release.
knolleary commentedon Apr 30, 2026
The PR for this has been merged and will be in Node-RED 5