Skip to content

A complete application tutorial to show how to implement the Web Socket protocol using only Node.js builtin modules

Notifications You must be signed in to change notification settings

ErickWendel/websockets-with-nodejs-from-scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Web Socket application using only Node.js built-in modules

About

Welcome, this repo is part of my youtube video about Building a complete application implementing the Web Socket protocol using only Node.js built-in modules.

First of all, leave your star 🌟 on this repo.

Access our exclusive telegram channel so I'll let you know about all the content I've been producing

Complete source code

Features Checklist + Challenges

  • Web Socket Server

    • Receiving data
      • Establishes handshake connections according to the Web Socket protocol
      • Receives masked data payloads
      • Decodes 7-bits long data payloads
      • Decodes 16-bits long data payloads
      • Decodes 64-bits long data payloads
    • Replying
      • Builds data frames according to the Web Socket protocol
      • Sends 7-bits long unmasked data payloads
      • Sends 16-bits long unmasked data payloads
      • Sends 64-bits long unmasked data payloads
  • Web Socket Client

    • Establishes handshake connections according to the Web Socket protocol
    • Sends masked data payloads
    • Receives masked and unmasked data payloads
    • Tries reconnecting to the server after a disconnection

Notes

  • Should you have some difficulties solving the problems, please comment on the Youtube video

  • As soon as you've been finishing the tasks, comment on the Youtube video so all other students can be pushed forward by your efforts

Running

  • Server - Use the Node.js v18 and execute the server.mjs file as node nodejs-raw-websocket/server.mjs
  • Client - You just need to open the index.html file on a browser. (I use Firefox for the examples)

Have fun!

About

A complete application tutorial to show how to implement the Web Socket protocol using only Node.js builtin modules

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published