Skip to content
/ ws Public

A demo application built using WebSocket on node js

Notifications You must be signed in to change notification settings

Vishwas1/ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

ws

Demo applications built using WebSocket on node js

Introduction

"The WebSocket protocol enables two-way communication between a client running untrusted code in a controlled environment to a remote host that has opted-in to communications from that code."

Goal

"The goal of this technology is to provide a mechanism for browser-based applications that need two-way communication with servers that does not rely on opening multiple HTTP connections."

The problem with TCP

Historically, creating web applications that need bidirectional communication between a client and a server (e.g., instant messaging and gaming applications) has required an abuse of HTTP to poll the server for updates

  • The server is forcer to use a number of different underlying TCP connections for each client.
  • High overhead with each client to server message having an HTTP header.
  • The client side script is forced to maintain a mapping from the outgoing connections to the incoming connections to track replies.

Solution

Use TCP connection for traffic in both directions. This is what webSocket provides. It is combined with WebSocket API (WSAPI), it provides an altenative to HTTP Polling for two-way communication from a webpage to a remote server.

Examples

  • games
  • stock tickers
  • multiuser applications with simultaneous editing
  • user interfaces exposing server-side services in real time
  • etc.

Notes:

  • Client server paradigm just like TCP
  • It combines the parts of UDP and TCP: it's message based like UDP, but it's reliable like TCP.
  • Bidirectional communication between client and server

About

A demo application built using WebSocket on node js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published