node-red-contrib-tcp-client-server-avd 1.1.1 → 1.2.0

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.
package/README.md CHANGED
@@ -1,16 +1,22 @@
1
1
  # Node-RED TCP Client/Server Node (AVD)
2
2
 
3
+ **Nederlands** | [English](#english)
4
+
3
5
  Een flexibele Node-RED node die functioneert als TCP client en/of TCP server, met uitgebreide configuratiemogelijkheden en foutafhandeling.
4
6
 
5
- ## Installatie
7
+ ---
8
+
9
+ ## Nederlands
10
+
11
+ ### Installatie
6
12
 
7
- ### Via npm (aanbevolen)
13
+ #### Via npm (aanbevolen)
8
14
 
9
15
  ```bash
10
16
  npm install node-red-contrib-tcp-client-server-avd
11
17
  ```
12
18
 
13
- ### Handmatige installatie
19
+ #### Handmatige installatie
14
20
 
15
21
  1. Clone of download dit project
16
22
  2. Kopieer de map naar je Node-RED `nodes` directory (meestal `~/.node-red/nodes/`)
@@ -21,9 +27,9 @@ npm install
21
27
  ```
22
28
  4. Herstart Node-RED
23
29
 
24
- ## Functionaliteiten
30
+ ### Functionaliteiten
25
31
 
26
- ### TCP Client Mode
32
+ #### TCP Client Mode
27
33
  - Automatisch verbinden bij flow start (optioneel)
28
34
  - Handmatig verbinden/verbreken via messages
29
35
  - Robuuste automatische herconnectie (detectie via error, close en write-fouten)
@@ -32,7 +38,7 @@ npm install
32
38
  - Message delimiter ondersteuning voor message framing
33
39
  - Keep-alive optie (aanbevolen voor detectie van half-open verbindingen)
34
40
 
35
- ### TCP Server Mode
41
+ #### TCP Server Mode
36
42
  - Automatisch starten bij flow start (optioneel)
37
43
  - Luisteren op geconfigureerde poort
38
44
  - Meerdere gelijktijdige client verbindingen
@@ -40,20 +46,20 @@ npm install
40
46
  - Broadcast naar alle clients of verzenden naar specifieke client
41
47
  - Zelfde dataformaat ondersteuning als client mode
42
48
 
43
- ### Gecombineerde Mode
49
+ #### Gecombineerde Mode
44
50
  - Gebruik zowel client als server functionaliteit in één node
45
51
  - Onafhankelijke configuratie voor beide modi
46
52
 
47
- ## Gebruik
53
+ ### Gebruik
48
54
 
49
- ### Basis Configuratie
55
+ #### Basis Configuratie
50
56
 
51
57
  1. Sleep de node naar je flow
52
58
  2. Dubbelklik op de node om te configureren
53
59
  3. Selecteer de gewenste mode: TCP Client, TCP Server, of TCP Client & Server
54
60
  4. Configureer de instellingen volgens je behoeften
55
61
 
56
- ### Client Mode - Verbinden
62
+ #### Client Mode - Verbinden
57
63
 
58
64
  **Automatisch verbinden:**
59
65
  - Zet "Auto Verbinden" aan
@@ -66,7 +72,7 @@ npm install
66
72
  **Verbinden verbreken:**
67
73
  - Stuur een message met `topic: "disconnect"` naar de node
68
74
 
69
- ### Server Mode - Server Beheer
75
+ #### Server Mode - Server Beheer
70
76
 
71
77
  **Automatisch starten:**
72
78
  - Zet "Auto Start" aan
@@ -79,299 +85,247 @@ npm install
79
85
  **Server stoppen:**
80
86
  - Stuur een message met `topic: "stop"` naar de node
81
87
 
82
- ## Message Formats
88
+ ### Message Formats
83
89
 
84
- ### Input Messages (naar Node)
90
+ #### Input Messages (naar Node)
85
91
 
86
- #### Client Mode
92
+ **Client Mode:**
87
93
 
88
- **Verbinden:**
89
- ```javascript
90
- { topic: "connect" }
91
- ```
94
+ | Actie | Message |
95
+ |-------|---------|
96
+ | Verbinden | `{ topic: "connect" }` |
97
+ | Verbreken | `{ topic: "disconnect" }` |
98
+ | Data verzenden | `{ topic: "send", payload: "data" }` |
92
99
 
93
- **Verbreken:**
94
- ```javascript
95
- { topic: "disconnect" }
96
- ```
100
+ Als er geen topic is opgegeven, wordt de payload automatisch verzonden.
97
101
 
98
- **Data verzenden:**
99
- ```javascript
100
- {
101
- topic: "send",
102
- payload: "data om te verzenden" // string, buffer, of object
103
- }
104
- ```
102
+ **Server Mode:**
105
103
 
106
- Als er geen topic is opgegeven, wordt de payload automatisch verzonden.
104
+ | Actie | Message |
105
+ |-------|---------|
106
+ | Server starten | `{ topic: "start" }` |
107
+ | Server stoppen | `{ topic: "stop" }` |
108
+ | Naar client | `{ topic: "send", clientId: "id", payload: "data" }` |
109
+ | Broadcast | `{ topic: "broadcast", payload: "data" }` |
107
110
 
108
- #### Server Mode
111
+ #### Output Messages (van Node)
109
112
 
110
- **Server starten:**
111
- ```javascript
112
- { topic: "start" }
113
- ```
113
+ **Client:** `topic: "status"` (connected/disconnected/error), `topic: "data"` (ontvangen data)
114
114
 
115
- **Server stoppen:**
116
- ```javascript
117
- { topic: "stop" }
118
- ```
115
+ **Server:** `topic: "status"`, `topic: "client/connected"`, `topic: "client/disconnected"`, `topic: "data"` (met `clientId`)
119
116
 
120
- **Data verzenden naar specifieke client:**
121
- ```javascript
122
- {
123
- topic: "send",
124
- clientId: "client-unique-id",
125
- payload: "data om te verzenden"
126
- }
127
- ```
117
+ ### ClientId bepalen (Server Mode)
128
118
 
129
- **Data verzenden naar alle clients (broadcast):**
130
- ```javascript
131
- {
132
- topic: "broadcast",
133
- payload: "data om te verzenden"
134
- }
135
- ```
119
+ De `clientId` is beschikbaar in `client/connected` en `data` messages. Gebruik `clientId: msg.clientId` in je send message.
136
120
 
137
- ### Output Messages (van Node)
121
+ ### Configuratie Opties
138
122
 
139
- #### Client Mode
123
+ **Client:** Host, Port (8080), IP Versie, Auto Verbinden, Herconnectie, Reconnect Interval (2 sec), Connection Timeout (10 sec), Input/Output Format, Encoding, Message Delimiter, Keep-Alive
140
124
 
141
- **Verbindingsstatus:**
142
- ```javascript
143
- {
144
- topic: "status",
145
- payload: "connected" | "disconnected" | "error",
146
- status: "connected" | "disconnected" | "error",
147
- error: "error message (indien van toepassing)"
148
- }
149
- ```
125
+ **Server:** Listen Port (8080), Bind Address (0.0.0.0), Auto Start, Max Connections, Connection Timeout (600 sec), Input/Output Format, Encoding, Message Delimiter, Keep-Alive
150
126
 
151
- **Ontvangen data:**
152
- ```javascript
153
- {
154
- topic: "data",
155
- payload: "ontvangen data",
156
- timestamp: "ISO timestamp"
157
- }
158
- ```
127
+ ### Status Weergave
159
128
 
160
- #### Server Mode
129
+ **Client:** Groen (verbonden), Rood (fout), Grijs (niet verbonden), Geel (verbinden)
161
130
 
162
- **Server status:**
163
- ```javascript
164
- {
165
- topic: "status",
166
- payload: "listening" | "stopped" | "error",
167
- port: 1234,
168
- error: "error message (indien van toepassing)"
169
- }
170
- ```
131
+ **Server:** Groen (luisterend), Rood (gestopt/fout), Blauw (actief met X clients)
171
132
 
172
- **Client verbinding:**
173
- ```javascript
174
- {
175
- topic: "client/connected",
176
- clientId: "unique-client-id",
177
- remoteAddress: "client-ip",
178
- remotePort: "client-port"
179
- }
180
- ```
133
+ ### Voorbeeld Flows
134
+
135
+ Importeer via **Menu (≡) → Import → Examples**:
136
+ - **Basis TCP Client** – Client verbindt met localhost:8080
137
+ - **Basis TCP Server** – Server luistert op 8080
138
+ - **Client-Server Echo** – Server stuurt echo terug naar client
139
+
140
+ ### Troubleshooting
141
+
142
+ - **Client kan niet verbinden:** Controleer server, firewall, host/port
143
+ - **Server kan niet starten:** Controleer poort beschikbaarheid, firewall, rechten
144
+ - **Data onjuist:** Controleer Output Format, Encoding, Delimiter
145
+
146
+ ### Bekende Beperkingen
147
+
148
+ - TLS/SSL nog niet ondersteund
149
+ - Alleen TCP (geen UDP)
150
+ - Geen rate limiting
181
151
 
182
- **Client verbreking:**
183
- ```javascript
184
- {
185
- topic: "client/disconnected",
186
- clientId: "unique-client-id"
187
- }
152
+ ---
153
+
154
+ ## English
155
+
156
+ **Nederlands** | [English](#english)
157
+
158
+ A flexible Node-RED node that acts as a TCP client and/or TCP server, with extensive configuration options and error handling.
159
+
160
+ ### Installation
161
+
162
+ #### Via npm (recommended)
163
+
164
+ ```bash
165
+ npm install node-red-contrib-tcp-client-server-avd
188
166
  ```
189
167
 
190
- **Ontvangen data:**
191
- ```javascript
192
- {
193
- topic: "data",
194
- payload: "ontvangen data",
195
- clientId: "unique-client-id",
196
- remoteAddress: "client-ip",
197
- remotePort: "client-port",
198
- timestamp: "ISO timestamp"
199
- }
168
+ #### Manual installation
169
+
170
+ 1. Clone or download this project
171
+ 2. Copy the folder to your Node-RED `nodes` directory (usually `~/.node-red/nodes/`)
172
+ 3. Install dependencies:
173
+ ```bash
174
+ cd ~/.node-red/nodes/node-red-contrib-tcp-client-server-avd
175
+ npm install
200
176
  ```
177
+ 4. Restart Node-RED
201
178
 
202
- ### ClientId bepalen (Server Mode)
179
+ ### Features
203
180
 
204
- Om naar een specifieke client te sturen heb je de `clientId` nodig. Deze is beschikbaar in:
181
+ #### TCP Client Mode
182
+ - Auto connect on flow start (optional)
183
+ - Manual connect/disconnect via messages
184
+ - Robust automatic reconnection (detection via error, close and write failures)
185
+ - Fast reconnection (default 2 sec, minimum 1 sec)
186
+ - Support for various data formats (String, Buffer, JSON, Hex)
187
+ - Message delimiter support for message framing
188
+ - Keep-alive option (recommended for detecting half-open connections)
205
189
 
206
- 1. **`client/connected`** bij elke nieuwe clientverbinding
207
- 2. **`data`** bij elk ontvangen bericht (via `msg.clientId`)
190
+ #### TCP Server Mode
191
+ - Auto start on flow start (optional)
192
+ - Listen on configured port
193
+ - Multiple simultaneous client connections
194
+ - Unique client identification
195
+ - Broadcast to all clients or send to specific client
196
+ - Same data format support as client mode
208
197
 
209
- Bewaar de `clientId` uit een van deze messages en gebruik deze in je `send` message met `clientId: msg.clientId`.
198
+ #### Combined Mode
199
+ - Use both client and server functionality in one node
200
+ - Independent configuration for both modes
210
201
 
211
- ## Configuratie Opties
202
+ ### Usage
212
203
 
213
- ### Client Mode
204
+ #### Basic Configuration
214
205
 
215
- - **Host**: Server hostname of IP adres (standaard: "localhost")
216
- - **Port**: Server poort nummer (standaard: 8080)
217
- - **IP Versie**: IPv4 of IPv6 (standaard: IPv4)
218
- - **Auto Verbinden**: Automatisch verbinden bij flow start (standaard: true)
219
- - **Herconnectie**: Automatische herconnectie bij verbroken verbinding (standaard: true)
220
- - **Reconnect Interval**: Tijd tussen reconnect pogingen in seconden (standaard: 2, minimum: 1)
221
- - **Max Reconnect Pogingen**: Maximum aantal reconnect pogingen (0 = oneindig, standaard: 0)
222
- - **Connection Timeout**: Timeout voor het opzetten van de verbinding in seconden (standaard: 10). Wordt na succesvol verbinden uitgeschakeld; geen idle-timeout.
223
- - **Input Format**: Data formaat voor verzenden (String, Buffer, JSON, Hex String)
224
- - **Output Format**: Data formaat voor ontvangen (String, Buffer, JSON, Hex String)
225
- - **Encoding**: Character encoding voor String format (UTF-8, ASCII, Latin1, Base64)
226
- - **Message Delimiter**: Optionele delimiter voor message framing (bijv. `\n` of `\r\n`)
227
- - **Keep-Alive**: TCP keep-alive optie (standaard: false). Aanbevolen voor vroegtijdige detectie van verbroken verbindingen.
206
+ 1. Drag the node to your flow
207
+ 2. Double-click the node to configure
208
+ 3. Select the desired mode: TCP Client, TCP Server, or TCP Client & Server
209
+ 4. Configure the settings according to your needs
228
210
 
229
- ### Server Mode
211
+ #### Client Mode - Connecting
230
212
 
231
- - **Listen Port**: Poort waarop de server luistert (standaard: 8080)
232
- - **Bind Address**: IP adres om aan te binden (standaard: "0.0.0.0" = alle interfaces)
233
- - **IP Versie**: IPv4 of IPv6 (standaard: IPv4)
234
- - **Auto Start**: Automatisch starten bij flow start (standaard: true)
235
- - **Max Connections**: Maximum aantal gelijktijdige verbindingen (0 = onbeperkt, standaard: 0)
236
- - **Connection Timeout**: Timeout voor client verbindingen in seconden (standaard: 600)
237
- - **Input Format**: Data formaat voor verzenden (String, Buffer, JSON, Hex String)
238
- - **Output Format**: Data formaat voor ontvangen (String, Buffer, JSON, Hex String)
239
- - **Encoding**: Character encoding voor String format (UTF-8, ASCII, Latin1, Base64)
240
- - **Message Delimiter**: Optionele delimiter voor message framing (bijv. `\n` of `\r\n`)
241
- - **Keep-Alive**: TCP keep-alive optie (standaard: false). Aanbevolen voor vroegtijdige detectie van verbroken verbindingen.
213
+ **Auto connect:**
214
+ - Enable "Auto Verbinden" (Auto Connect)
215
+ - The client connects automatically on flow start
242
216
 
243
- ## Status Weergave
217
+ **Manual connect:**
218
+ - Disable "Auto Verbinden"
219
+ - Send a message with `topic: "connect"` to the node
244
220
 
245
- De node toont verschillende status indicatoren:
221
+ **Disconnect:**
222
+ - Send a message with `topic: "disconnect"` to the node
246
223
 
247
- ### Client Mode
248
- - **Groen (verbonden)**: Succesvol verbonden met server
249
- - **Rood (fout)**: Verbindingsfout of verbreken
250
- - **Grijs (niet verbonden)**: Niet verbonden
251
- - **Geel (verbinden)**: Verbinding wordt tot stand gebracht
224
+ #### Server Mode - Server Management
252
225
 
253
- ### Server Mode
254
- - **Groen (luisterend)**: Server luistert actief op poort
255
- - **Rood (gestopt/fout)**: Server is gestopt of fout opgetreden
256
- - **Blauw (actief)**: Server actief met X verbindingen
226
+ **Auto start:**
227
+ - Enable "Auto Start"
228
+ - The server starts automatically on flow start
257
229
 
258
- ## Voorbeelden
230
+ **Manual start:**
231
+ - Disable "Auto Start"
232
+ - Send a message with `topic: "start"` to the node
259
233
 
260
- ### Voorbeeld 1: Basis TCP Client
234
+ **Stop server:**
235
+ - Send a message with `topic: "stop"` to the node
261
236
 
262
- Een eenvoudige TCP client die verbindt met een server en data verzendt/ontvangt.
237
+ ### Message Formats
263
238
 
264
- **Flow:**
265
- ```
266
- [Inject] → [TCP Client Node] → [Debug]
267
- ```
239
+ #### Input Messages (to Node)
268
240
 
269
- **Configuratie:**
270
- - Mode: TCP Client
271
- - Host: localhost
272
- - Port: 8080
273
- - Auto Verbinden: aan
241
+ **Client Mode:**
274
242
 
275
- ### Voorbeeld 2: Basis TCP Server
243
+ | Action | Message |
244
+ |--------|---------|
245
+ | Connect | `{ topic: "connect" }` |
246
+ | Disconnect | `{ topic: "disconnect" }` |
247
+ | Send data | `{ topic: "send", payload: "data" }` |
276
248
 
277
- Een TCP server die luistert op poort 8080 en data ontvangt van clients.
249
+ If no topic is specified, the payload is sent automatically.
278
250
 
279
- **Flow:**
280
- ```
281
- [TCP Server Node] → [Debug]
282
- ```
251
+ **Server Mode:**
283
252
 
284
- **Configuratie:**
285
- - Mode: TCP Server
286
- - Listen Port: 8080
287
- - Auto Start: aan
253
+ | Action | Message |
254
+ |--------|---------|
255
+ | Start server | `{ topic: "start" }` |
256
+ | Stop server | `{ topic: "stop" }` |
257
+ | To client | `{ topic: "send", clientId: "id", payload: "data" }` |
258
+ | Broadcast | `{ topic: "broadcast", payload: "data" }` |
288
259
 
289
- ### Voorbeeld 3: Client met Reconnect
260
+ #### Output Messages (from Node)
290
261
 
291
- Een TCP client met automatische herconnectie.
262
+ **Client:** `topic: "status"` (connected/disconnected/error), `topic: "data"` (received data)
292
263
 
293
- **Configuratie:**
294
- - Mode: TCP Client
295
- - Host: 192.168.1.100
296
- - Port: 8080
297
- - Auto Verbinden: aan
298
- - Herconnectie: aan
299
- - Reconnect Interval: 2 seconden (of 1 voor snellere herverbinding)
300
- - Max Reconnect Pogingen: 0 (oneindig)
264
+ **Server:** `topic: "status"`, `topic: "client/connected"`, `topic: "client/disconnected"`, `topic: "data"` (with `clientId`)
301
265
 
302
- ### Voorbeeld 4: Server met Meerdere Clients
266
+ ### Determining ClientId (Server Mode)
303
267
 
304
- Een TCP server die data ontvangt van meerdere clients en responses terugstuurt.
268
+ The `clientId` is available in `client/connected` and `data` messages. Use `clientId: msg.clientId` in your send message.
305
269
 
306
- **Flow:**
307
- ```
308
- [TCP Server Node] → [Function Node] → [TCP Server Node]
309
- ```
270
+ ### Configuration Options
310
271
 
311
- **Function Node code:**
312
- ```javascript
313
- // Echo de data terug naar dezelfde client (clientId uit ontvangen bericht)
314
- if (msg.topic === "data") {
315
- return {
316
- topic: "send",
317
- clientId: msg.clientId,
318
- payload: "Echo: " + msg.payload
319
- };
320
- }
321
- return null;
322
- ```
272
+ **Client:** Host, Port (8080), IP Version, Auto Connect, Reconnect, Reconnect Interval (2 sec), Connection Timeout (10 sec), Input/Output Format, Encoding, Message Delimiter, Keep-Alive
273
+
274
+ **Server:** Listen Port (8080), Bind Address (0.0.0.0), Auto Start, Max Connections, Connection Timeout (600 sec), Input/Output Format, Encoding, Message Delimiter, Keep-Alive
323
275
 
324
- ## Troubleshooting
276
+ ### Status Display
325
277
 
326
- ### Client kan niet verbinden
278
+ **Client:** Green (connected), Red (error), Grey (disconnected), Yellow (connecting)
327
279
 
328
- 1. Controleer of de server draait en bereikbaar is
329
- 2. Controleer firewall instellingen
330
- 3. Controleer host en port configuratie
331
- 4. Bekijk de status van de node voor foutmeldingen
280
+ **Server:** Green (listening), Red (stopped/error), Blue (active with X clients)
332
281
 
333
- ### Server kan niet starten
282
+ ### Example Flows
334
283
 
335
- 1. Controleer of de poort niet al in gebruik is
336
- 2. Controleer of je rechten hebt om op de poort te luisteren (voor poorten < 1024 op Linux/Mac)
337
- 3. Controleer firewall instellingen
338
- 4. Bekijk de status van de node voor foutmeldingen
284
+ Import via **Menu (≡) Import Examples**:
285
+ - **Basis TCP Client** Client connects to localhost:8080
286
+ - **Basis TCP Server** – Server listens on 8080
287
+ - **Client-Server Echo** Server sends echo back to client
339
288
 
340
- ### Data wordt niet correct ontvangen
289
+ ### Troubleshooting
341
290
 
342
- 1. Controleer de Output Format configuratie
343
- 2. Controleer de Encoding instelling
344
- 3. Voor message framing, gebruik de Message Delimiter optie
345
- 4. Voor binary data, gebruik Buffer format
291
+ - **Client cannot connect:** Check server, firewall, host/port
292
+ - **Server cannot start:** Check port availability, firewall, permissions
293
+ - **Incorrect data:** Check Output Format, Encoding, Delimiter
346
294
 
347
- ## Bekende Beperkingen
295
+ ### Known Limitations
348
296
 
349
- - TLS/SSL ondersteuning is nog niet geïmplementeerd (toekomstige versie)
350
- - UDP protocol wordt niet ondersteund (alleen TCP)
351
- - Rate limiting is nog niet beschikbaar
297
+ - TLS/SSL not yet supported
298
+ - TCP only (no UDP)
299
+ - No rate limiting
352
300
 
353
- ## Licentie
301
+ ---
302
+
303
+ ## License
354
304
 
355
305
  MIT
356
306
 
357
- ## Versie Geschiedenis
307
+ ## Version History
308
+
309
+ ### Version 1.2.0
310
+ - Example flows: Basis TCP Client, Basis TCP Server, Client-Server Echo (via Import → Examples)
311
+ - Bilingual README (Nederlands/English)
358
312
 
359
- ### Versie 1.1.0
360
- - Robuuste verbindingscontrole: error handler triggert socket.destroy() voor betrouwbare herverbinding
361
- - Write-error detectie: bij mislukte verzending wordt herverbinding gestart
362
- - Snellere herverbinding: standaard 2 sec, minimum 1 sec
363
- - Geen idle-timeout na verbinden: verbinding blijft open zolang beide partijen verbonden zijn
364
- - Voorkomen dubbele reconnect en race conditions
313
+ ### Version 1.1.0
314
+ - Robust connection control: error handler triggers socket.destroy() for reliable reconnection
315
+ - Write error detection: reconnection starts on failed send
316
+ - Faster reconnection: default 2 sec, minimum 1 sec
317
+ - No idle timeout after connect: connection stays open as long as both parties are connected
318
+ - Prevention of double reconnect and race conditions
365
319
 
366
- ### Versie 1.0.0
367
- - Initiele release
368
- - TCP Client functionaliteit
369
- - TCP Server functionaliteit
370
- - Gecombineerde mode
371
- - String, Buffer, JSON, en Hex data formaten
372
- - Automatische herconnectie
373
- - Message delimiter ondersteuning
320
+ ### Version 1.0.0
321
+ - Initial release
322
+ - TCP Client functionality
323
+ - TCP Server functionality
324
+ - Combined mode
325
+ - String, Buffer, JSON, and Hex data formats
326
+ - Automatic reconnection
327
+ - Message delimiter support
374
328
 
375
- ## Ondersteuning
329
+ ## Support
376
330
 
377
- Voor vragen, problemen of suggesties, open een issue op de GitHub repository.
331
+ For questions, issues or suggestions, open an issue on the GitHub repository.
@@ -0,0 +1,86 @@
1
+ [
2
+ {
3
+ "id": "tab1",
4
+ "type": "tab",
5
+ "label": "Basis TCP Client",
6
+ "disabled": false
7
+ },
8
+ {
9
+ "id": "comment1",
10
+ "type": "comment",
11
+ "z": "tab1",
12
+ "name": "TCP Client die verbindt met localhost:8080. Start eerst de Server flow. De Inject node stuurt 'Hello' naar de server.",
13
+ "info": "",
14
+ "x": 350,
15
+ "y": 40,
16
+ "wires": []
17
+ },
18
+ {
19
+ "id": "inject1",
20
+ "type": "inject",
21
+ "z": "tab1",
22
+ "name": "Verstuur",
23
+ "props": [{"p": "payload"}],
24
+ "repeat": "",
25
+ "crontab": "",
26
+ "once": false,
27
+ "onceDelay": 0.1,
28
+ "topic": "send",
29
+ "payload": "Hello",
30
+ "payloadType": "str",
31
+ "x": 130,
32
+ "y": 120,
33
+ "wires": [["tcp1"]]
34
+ },
35
+ {
36
+ "id": "tcp1",
37
+ "type": "tcp-client-server-avd",
38
+ "z": "tab1",
39
+ "name": "TCP Client",
40
+ "mode": "client",
41
+ "clientHost": "localhost",
42
+ "clientPort": "8080",
43
+ "clientIpVersion": "4",
44
+ "clientAutoConnect": true,
45
+ "clientReconnect": true,
46
+ "clientReconnectInterval": "2",
47
+ "clientMaxReconnectAttempts": "0",
48
+ "clientConnectionTimeout": "10",
49
+ "clientInputFormat": "string",
50
+ "clientOutputFormat": "string",
51
+ "clientEncoding": "utf8",
52
+ "clientDelimiter": "",
53
+ "clientKeepAlive": false,
54
+ "serverPort": "8080",
55
+ "serverBindAddress": "0.0.0.0",
56
+ "serverIpVersion": "4",
57
+ "serverAutoStart": true,
58
+ "serverMaxConnections": "0",
59
+ "serverConnectionTimeout": "600",
60
+ "serverInputFormat": "string",
61
+ "serverOutputFormat": "string",
62
+ "serverEncoding": "utf8",
63
+ "serverDelimiter": "",
64
+ "serverKeepAlive": false,
65
+ "x": 340,
66
+ "y": 120,
67
+ "wires": [["debug1"]]
68
+ },
69
+ {
70
+ "id": "debug1",
71
+ "type": "debug",
72
+ "z": "tab1",
73
+ "name": "Output",
74
+ "active": true,
75
+ "tosidebar": true,
76
+ "console": false,
77
+ "tostatus": false,
78
+ "complete": "payload",
79
+ "targetType": "msg",
80
+ "statusVal": "",
81
+ "statusType": "auto",
82
+ "x": 540,
83
+ "y": 120,
84
+ "wires": []
85
+ }
86
+ ]
@@ -0,0 +1,69 @@
1
+ [
2
+ {
3
+ "id": "tab1",
4
+ "type": "tab",
5
+ "label": "Basis TCP Server",
6
+ "disabled": false
7
+ },
8
+ {
9
+ "id": "comment1",
10
+ "type": "comment",
11
+ "z": "tab1",
12
+ "name": "TCP Server die luistert op poort 8080. Ontvangt data van clients en toont deze in de Debug output.",
13
+ "info": "",
14
+ "x": 330,
15
+ "y": 40,
16
+ "wires": []
17
+ },
18
+ {
19
+ "id": "tcp1",
20
+ "type": "tcp-client-server-avd",
21
+ "z": "tab1",
22
+ "name": "TCP Server",
23
+ "mode": "server",
24
+ "clientHost": "localhost",
25
+ "clientPort": "8080",
26
+ "clientIpVersion": "4",
27
+ "clientAutoConnect": true,
28
+ "clientReconnect": true,
29
+ "clientReconnectInterval": "2",
30
+ "clientMaxReconnectAttempts": "0",
31
+ "clientConnectionTimeout": "10",
32
+ "clientInputFormat": "string",
33
+ "clientOutputFormat": "string",
34
+ "clientEncoding": "utf8",
35
+ "clientDelimiter": "",
36
+ "clientKeepAlive": false,
37
+ "serverPort": "8080",
38
+ "serverBindAddress": "0.0.0.0",
39
+ "serverIpVersion": "4",
40
+ "serverAutoStart": true,
41
+ "serverMaxConnections": "0",
42
+ "serverConnectionTimeout": "600",
43
+ "serverInputFormat": "string",
44
+ "serverOutputFormat": "string",
45
+ "serverEncoding": "utf8",
46
+ "serverDelimiter": "",
47
+ "serverKeepAlive": false,
48
+ "x": 330,
49
+ "y": 120,
50
+ "wires": [["debug1"]]
51
+ },
52
+ {
53
+ "id": "debug1",
54
+ "type": "debug",
55
+ "z": "tab1",
56
+ "name": "Ontvangen data",
57
+ "active": true,
58
+ "tosidebar": true,
59
+ "console": false,
60
+ "tostatus": false,
61
+ "complete": "true",
62
+ "targetType": "msg",
63
+ "statusVal": "",
64
+ "statusType": "auto",
65
+ "x": 540,
66
+ "y": 120,
67
+ "wires": []
68
+ }
69
+ ]
@@ -0,0 +1,67 @@
1
+ [
2
+ {
3
+ "id": "tab1",
4
+ "type": "tab",
5
+ "label": "Client-Server Echo",
6
+ "disabled": false
7
+ },
8
+ {
9
+ "id": "comment1",
10
+ "type": "comment",
11
+ "z": "tab1",
12
+ "name": "Server ontvangt data en stuurt echo terug naar dezelfde client. Importeer ook 'Basis TCP Client' om te testen.",
13
+ "info": "",
14
+ "x": 350,
15
+ "y": 40,
16
+ "wires": []
17
+ },
18
+ {
19
+ "id": "tcp1",
20
+ "type": "tcp-client-server-avd",
21
+ "z": "tab1",
22
+ "name": "TCP Server",
23
+ "mode": "server",
24
+ "clientHost": "localhost",
25
+ "clientPort": "8080",
26
+ "clientIpVersion": "4",
27
+ "clientAutoConnect": true,
28
+ "clientReconnect": true,
29
+ "clientReconnectInterval": "2",
30
+ "clientMaxReconnectAttempts": "0",
31
+ "clientConnectionTimeout": "10",
32
+ "clientInputFormat": "string",
33
+ "clientOutputFormat": "string",
34
+ "clientEncoding": "utf8",
35
+ "clientDelimiter": "",
36
+ "clientKeepAlive": false,
37
+ "serverPort": "8080",
38
+ "serverBindAddress": "0.0.0.0",
39
+ "serverIpVersion": "4",
40
+ "serverAutoStart": true,
41
+ "serverMaxConnections": "0",
42
+ "serverConnectionTimeout": "600",
43
+ "serverInputFormat": "string",
44
+ "serverOutputFormat": "string",
45
+ "serverEncoding": "utf8",
46
+ "serverDelimiter": "",
47
+ "serverKeepAlive": false,
48
+ "x": 330,
49
+ "y": 140,
50
+ "wires": [["function1"]]
51
+ },
52
+ {
53
+ "id": "function1",
54
+ "type": "function",
55
+ "z": "tab1",
56
+ "name": "Echo naar client",
57
+ "func": "// Stuur de ontvangen data terug naar dezelfde client\nif (msg.topic === \"data\") {\n return {\n topic: \"send\",\n clientId: msg.clientId,\n payload: \"Echo: \" + msg.payload\n };\n}\nreturn null;",
58
+ "outputs": 1,
59
+ "noerr": 0,
60
+ "initialize": "",
61
+ "finalize": "",
62
+ "libs": [],
63
+ "x": 550,
64
+ "y": 140,
65
+ "wires": [["tcp1"]]
66
+ }
67
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-tcp-client-server-avd",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Node-RED node voor TCP client en/of server functionaliteit",
5
5
  "keywords": [
6
6
  "node-red",