Skip to content
/ ws Public

Demo project to illustrate websocket protocol

Notifications You must be signed in to change notification settings

kislerdm/ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebSocket Demo

The project illustrates a use case of the websocket (ws) protocol.

Modus Operandi

  • The client app sends empty request to the server.
  • Upon successful handshake, the server pushes current UTC timestamp formated as the ISO string. It's done perpetually with the delay of 200 ms. between two consecutive responses.
  • Client app tails and displays 20 most recent responses.
sequenceDiagram
    participant web as Web Browser
    participant http as "/" endpoint
    participant ws as "/ws" endpoint
    
    web->>+http: Initial call
    http->>-web: Returns HTML page with embedded JS
    
    web->>+ws: Sends empty message
    ws->>-web: Returns current timestamp every 200 ms. 
Loading

How to run

Prerequisites

Commands

  • Run to see available commands:
make help
  • Run to start the server:
make start
  • Run to stop the server and clean the environment:
make stop

About

Demo project to illustrate websocket protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published