Skip to content
/ node-tcp Public

multi-client communication with broadcast server

Notifications You must be signed in to change notification settings

pawk/node-tcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

multi-client communication with broadcast server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published