Skip to content

A broadcast server built using websocket and utilizing long polling to manage connected clients

Notifications You must be signed in to change notification settings

Tribhuwan-Joshi/broadcast-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Broadcast Server

The Broadcast Server enables real-time communication using WebSockets. Clients can connect to the server, creating a persistent connection that allows data to be transmitted seamlessly between both sides.

Features

  • WebSocket Broadcasting: WebSocket protocol is used for bidirectional communication between the server and clients.
  • Connection Management: Clients connect to the server by creating a new WebSocket instance (new WebSocket(ws://)).
  • Ping-Pong Mechanism: Long polling ensures the connection stays active, with periodic ping-pong messages to check if everything is still live.
  • User Interface: A simple interface for user input is created using Node.js readline.

Theory

WebSocket is a protocol that supports two-way communication over a single, long-lived connection. After a connection is made, the server sends an HTTP response with status 101 Switching Protocols, upgrading the connection to WebSocket.

  • Client-Server Interaction: Once the WebSocket connection is established, both the server and client can send and receive messages in real-time.
  • Ping-Pong: The ping-pong mechanism keeps the connection alive. The server and client send ping and pong messages to make sure the connection is still active and can handle broadcasting messages.

About

A broadcast server built using websocket and utilizing long polling to manage connected clients

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published