node-red-contrib-tcp-client-server-avd 1.1.0 → 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 +193 -239
- package/examples/Basis TCP Client.json +86 -0
- package/examples/Basis TCP Server.json +69 -0
- package/examples/Client-Server Echo.json +67 -0
- package/nodes/tcp-client-server.js +21 -3
- package/package.json +4 -1
- package/NodeRedTCP/README.md +0 -408
- package/NodeRedTCP/SPECIFICATIE.md +0 -460
- package/NodeRedTCP/nodes/tcp-client-server-avd.html +0 -298
- package/NodeRedTCP/nodes/tcp-client-server-avd.js +0 -606
- package/NodeRedTCP/package.json +0 -32
- package/SPECIFICATIE.md +0 -402
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
|
-
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Nederlands
|
|
10
|
+
|
|
11
|
+
### Installatie
|
|
6
12
|
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
30
|
+
### Functionaliteiten
|
|
25
31
|
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
49
|
+
#### Gecombineerde Mode
|
|
44
50
|
- Gebruik zowel client als server functionaliteit in één node
|
|
45
51
|
- Onafhankelijke configuratie voor beide modi
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
### Gebruik
|
|
48
54
|
|
|
49
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
88
|
+
### Message Formats
|
|
83
89
|
|
|
84
|
-
|
|
90
|
+
#### Input Messages (naar Node)
|
|
85
91
|
|
|
86
|
-
|
|
92
|
+
**Client Mode:**
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
94
|
-
```javascript
|
|
95
|
-
{ topic: "disconnect" }
|
|
96
|
-
```
|
|
100
|
+
Als er geen topic is opgegeven, wordt de payload automatisch verzonden.
|
|
97
101
|
|
|
98
|
-
**
|
|
99
|
-
```javascript
|
|
100
|
-
{
|
|
101
|
-
topic: "send",
|
|
102
|
-
payload: "data om te verzenden" // string, buffer, of object
|
|
103
|
-
}
|
|
104
|
-
```
|
|
102
|
+
**Server Mode:**
|
|
105
103
|
|
|
106
|
-
|
|
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
|
-
####
|
|
111
|
+
#### Output Messages (van Node)
|
|
109
112
|
|
|
110
|
-
**
|
|
111
|
-
```javascript
|
|
112
|
-
{ topic: "start" }
|
|
113
|
-
```
|
|
113
|
+
**Client:** `topic: "status"` (connected/disconnected/error), `topic: "data"` (ontvangen data)
|
|
114
114
|
|
|
115
|
-
**Server
|
|
116
|
-
```javascript
|
|
117
|
-
{ topic: "stop" }
|
|
118
|
-
```
|
|
115
|
+
**Server:** `topic: "status"`, `topic: "client/connected"`, `topic: "client/disconnected"`, `topic: "data"` (met `clientId`)
|
|
119
116
|
|
|
120
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
121
|
+
### Configuratie Opties
|
|
138
122
|
|
|
139
|
-
|
|
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
|
-
**
|
|
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
|
-
|
|
152
|
-
```javascript
|
|
153
|
-
{
|
|
154
|
-
topic: "data",
|
|
155
|
-
payload: "ontvangen data",
|
|
156
|
-
timestamp: "ISO timestamp"
|
|
157
|
-
}
|
|
158
|
-
```
|
|
127
|
+
### Status Weergave
|
|
159
128
|
|
|
160
|
-
|
|
129
|
+
**Client:** Groen (verbonden), Rood (fout), Grijs (niet verbonden), Geel (verbinden)
|
|
161
130
|
|
|
162
|
-
**Server
|
|
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
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
###
|
|
179
|
+
### Features
|
|
203
180
|
|
|
204
|
-
|
|
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
|
-
|
|
207
|
-
|
|
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
|
-
|
|
198
|
+
#### Combined Mode
|
|
199
|
+
- Use both client and server functionality in one node
|
|
200
|
+
- Independent configuration for both modes
|
|
210
201
|
|
|
211
|
-
|
|
202
|
+
### Usage
|
|
212
203
|
|
|
213
|
-
|
|
204
|
+
#### Basic Configuration
|
|
214
205
|
|
|
215
|
-
|
|
216
|
-
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
211
|
+
#### Client Mode - Connecting
|
|
230
212
|
|
|
231
|
-
|
|
232
|
-
-
|
|
233
|
-
-
|
|
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
|
-
|
|
217
|
+
**Manual connect:**
|
|
218
|
+
- Disable "Auto Verbinden"
|
|
219
|
+
- Send a message with `topic: "connect"` to the node
|
|
244
220
|
|
|
245
|
-
|
|
221
|
+
**Disconnect:**
|
|
222
|
+
- Send a message with `topic: "disconnect"` to the node
|
|
246
223
|
|
|
247
|
-
|
|
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
|
-
|
|
254
|
-
-
|
|
255
|
-
-
|
|
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
|
-
|
|
230
|
+
**Manual start:**
|
|
231
|
+
- Disable "Auto Start"
|
|
232
|
+
- Send a message with `topic: "start"` to the node
|
|
259
233
|
|
|
260
|
-
|
|
234
|
+
**Stop server:**
|
|
235
|
+
- Send a message with `topic: "stop"` to the node
|
|
261
236
|
|
|
262
|
-
|
|
237
|
+
### Message Formats
|
|
263
238
|
|
|
264
|
-
|
|
265
|
-
```
|
|
266
|
-
[Inject] → [TCP Client Node] → [Debug]
|
|
267
|
-
```
|
|
239
|
+
#### Input Messages (to Node)
|
|
268
240
|
|
|
269
|
-
**
|
|
270
|
-
- Mode: TCP Client
|
|
271
|
-
- Host: localhost
|
|
272
|
-
- Port: 8080
|
|
273
|
-
- Auto Verbinden: aan
|
|
241
|
+
**Client Mode:**
|
|
274
242
|
|
|
275
|
-
|
|
243
|
+
| Action | Message |
|
|
244
|
+
|--------|---------|
|
|
245
|
+
| Connect | `{ topic: "connect" }` |
|
|
246
|
+
| Disconnect | `{ topic: "disconnect" }` |
|
|
247
|
+
| Send data | `{ topic: "send", payload: "data" }` |
|
|
276
248
|
|
|
277
|
-
|
|
249
|
+
If no topic is specified, the payload is sent automatically.
|
|
278
250
|
|
|
279
|
-
**
|
|
280
|
-
```
|
|
281
|
-
[TCP Server Node] → [Debug]
|
|
282
|
-
```
|
|
251
|
+
**Server Mode:**
|
|
283
252
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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
|
-
|
|
260
|
+
#### Output Messages (from Node)
|
|
290
261
|
|
|
291
|
-
|
|
262
|
+
**Client:** `topic: "status"` (connected/disconnected/error), `topic: "data"` (received data)
|
|
292
263
|
|
|
293
|
-
**
|
|
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
|
-
###
|
|
266
|
+
### Determining ClientId (Server Mode)
|
|
303
267
|
|
|
304
|
-
|
|
268
|
+
The `clientId` is available in `client/connected` and `data` messages. Use `clientId: msg.clientId` in your send message.
|
|
305
269
|
|
|
306
|
-
|
|
307
|
-
```
|
|
308
|
-
[TCP Server Node] → [Function Node] → [TCP Server Node]
|
|
309
|
-
```
|
|
270
|
+
### Configuration Options
|
|
310
271
|
|
|
311
|
-
**
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
276
|
+
### Status Display
|
|
325
277
|
|
|
326
|
-
|
|
278
|
+
**Client:** Green (connected), Red (error), Grey (disconnected), Yellow (connecting)
|
|
327
279
|
|
|
328
|
-
|
|
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
|
-
###
|
|
282
|
+
### Example Flows
|
|
334
283
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
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
|
-
###
|
|
289
|
+
### Troubleshooting
|
|
341
290
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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
|
-
|
|
295
|
+
### Known Limitations
|
|
348
296
|
|
|
349
|
-
- TLS/SSL
|
|
350
|
-
-
|
|
351
|
-
-
|
|
297
|
+
- TLS/SSL not yet supported
|
|
298
|
+
- TCP only (no UDP)
|
|
299
|
+
- No rate limiting
|
|
352
300
|
|
|
353
|
-
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## License
|
|
354
304
|
|
|
355
305
|
MIT
|
|
356
306
|
|
|
357
|
-
##
|
|
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
|
-
###
|
|
360
|
-
-
|
|
361
|
-
- Write
|
|
362
|
-
-
|
|
363
|
-
-
|
|
364
|
-
-
|
|
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
|
-
###
|
|
367
|
-
-
|
|
368
|
-
- TCP Client
|
|
369
|
-
- TCP Server
|
|
370
|
-
-
|
|
371
|
-
- String, Buffer, JSON,
|
|
372
|
-
-
|
|
373
|
-
- Message delimiter
|
|
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
|
-
##
|
|
329
|
+
## Support
|
|
376
330
|
|
|
377
|
-
|
|
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
|
+
]
|