https://github.com/pawk/node-tcp
multi-client communication with broadcast server
https://github.com/pawk/node-tcp
nodejs tcp
Last synced: 3 months ago
JSON representation
multi-client communication with broadcast server
- Host: GitHub
- URL: https://github.com/pawk/node-tcp
- Owner: pawk
- Created: 2018-08-14T09:18:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-16T08:43:27.000Z (over 7 years ago)
- Last Synced: 2025-04-03T16:43:55.274Z (10 months ago)
- Topics: nodejs, tcp
- Language: JavaScript
- Homepage:
- Size: 556 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TCP in nodejs
> Communication between multiple clients (with server relaying messages)

Program consists of two parts: client and server.
Open a terminal and run
```
npm run server
```
In the next window go with
```
npm run client
```
Type something in either of the terminals and hit Enter. Observe two way communication between the client and the server.
Now run at least one more client. Send some messages from either of the terminals. Observe how server broadcasts messages to all of the connected clients.
> It does that using single PassThrough stream which is piped to every connected socket