К содержимому
learnspaceYOUR NEXT CHAPTER
ПРОСТРАНСТВО ОБУЧЕНИЯ
ГлавнаяКаталог курсовМоё обучениеCoursera

Знания без границ

Учитесь у лучших университетов и компаний мира.

Открыть Coursera
Интеграция
Пространство университета
Моё пространствоСтраница курса
↵
ЯЛичный кабинетСтудент
© 2026 LearnSpaceКаждый день — возможность узнать больше.Помощь
Authentic Node.js WebSocket Server Workshop · LearnSpace
Назад в каталог
courseraIT и технологии

Authentic Node.js WebSocket Server Workshop

Курс от Packt
Средний≈ 12.4 чАнглийский
О курсеНавыкиПрограммаПреподаватели

О курсе

Updated in May 2025. This course now features Coursera Coach! A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. Unlock the full power of real-time web communication by building a standards-compliant WebSocket server from the ground up. This hands-on course offers an immersive deep dive into the WebSocket protocol using Node.js, helping you truly understand what happens behind the scenes during client-server messaging. By the end of the course, you'll be equipped to implement bidirectional data flow in your own apps with precision and confidence. You'll start by setting up a Node.js HTTP server and enhancing it with custom modules, error handling, and RFC 6455 compliance. Once the foundation is in place, you'll progress to implementing the WebSocket handshake process, parsing headers, and verifying client requests using cryptographic hashing techniques. Debugging and testing are integrated throughout the course to reinforce best practices. In the core modules, you'll master how to receive and decode binary WebSocket frames, handle small to large payloads, and use buffers, bitwise operators, and masking logic for reliable data processing. Then, you'll dive into server-to-client communication, frame construction, and echo responses. The final section focuses on gracefully handling connection closures and error frames, ensuring your implementation is robust and production-ready. This course is ideal for backend developers, full-stack engineers, or anyone looking to gain an authentic understanding of the WebSocket protocol beyond abstractions. A working knowledge of JavaScript and Node.js is required. This is an intermediate-level course designed for those ready to move past high-level libraries and explore the core mechanics of real-time networking.

Навыки, которые вы освоите

Node.JSNetwork ProtocolsDebuggingServer SideWeb ApplicationsCryptographic ProtocolsJavascriptWeb ServersCryptographyReal Time Data

Программа курса

6 модулей · 90 учебных материалов

01Introduction3 материалов

Introduction

IntroductionВидеоFull Course ResourcesЧтениеTo build a WebSocket server, we need to be RFC compliantВидео
02Creating a NodeJS Server8 материалов

Creating a NodeJS Server

Учитесь у экспертов

Packt - Course Instructors

Преподаватель курса

Authentic Node.js WebSocket Server Workshop
В каталоге вашей программы

Инвестируйте в себя

Новые знания — в удобное для вас время.

Начать на Coursera

Обучение откроется на Coursera
в новой вкладке

Обучение на Coursera

≈ 12.4 ч

6 модулей

Язык: Английский

Субтитры: Казахский

Часть программы вашего университета
Overview of HTML and CSSВидео
Setting up our HTTP serverВидео
Creating custom modules and finishing off the HTTP serverВидео
Implementing basic error handlingВидео
Using "Run and Debug" to examine the forEach loopВидео
Testing our error handling codeВидео
Establishing a WebSocket ConnectionDIALOGUE
Creating a NodeJS Server - AssessmentЗадание
03Establishing a WebSocket Connection11 материалов

Establishing a WebSocket Connection

Using the 'upgrade' event listener to receive three important objectsВидеоExamining the request object in the terminalВидеоReading the client's opening handshake request headersВидеоSending a "400 Bad Request" response if the client handshake headers failВидеоGenerate the server response headers objectВидеоExtracting the Sec-WebSocket-Key and using the crypto moduleВидеоTimeout! What is SHA-hashing and the crypto module?ВидеоGenerate the Sec-WebSocket-Accept value and send back headers to the clientВидеоTesting our code and opening up a valid WebSocket connectionВидеоUnderstanding WebSocket Handshakes with Node.jsDIALOGUEEstablishing a WebSocket Connection - AssessmentЗадание
04Receiving WebSocket Data36 материалов

Receiving WebSocket Data

Setting up our file for the next goalВидеоThe socket object inherits from the stream.Duplex classВидеоDefining our data event handlerВидеоQuick cut - adding the 'end' event listener to our socket objectВидеоDefine the processBuffer() functionВидеоThe WebSocket binary frame structureВидеоCoding the task management looping functionВидеоExtract the first 2 bytes of data from the WebSocket data frameВидеоWhat are Buffers?ВидеоWhy is the letter "a" sent as 7 bytes?ВидеоUsing the Debugger tool to analyze codeВидеоExtracting the FIN bitВидеоBitwise operatorsВидеоExtracting the MASK, OPCODE and initial LENGTH informationВидеоSetting up code to extract the payload length detailsВидеоThe 3 categories of payload lengthsВидеоCalculating the payload lengthВидеоPayload length checksВидеоExtract the Masking KeyВидеоDefine the getPayload() methodВидеоExtract one full frame of data (masked)ВидеоUnmasking the frame payloadВидеоWhat is the modulus operand?ВидеоCreate a persistent fragments array and check for more frames (FIN bit check)ВидеоSMALL payloads - Using the debugger to analyze logicВидеоFixing the error in our consumePayload() methodВидеоAdding a prepopulate button to the HTMLВидеоMEDIUM Payloads - Using the debugger to analyze logicВидеоLARGE Payloads: Part 1 of 3. Understanding getLength() logicВидеоLARGE Payloads: Part 2 of 3. Waiting for additional chunksВидеоLARGE Payloads: Part 3 of 3. Processing the entire payload into _fragmentsВидеоImprovements, comments, and adding opcode checksВидеоAdvanced - chunk size variation between debugger vs live environmentВидеоImproving our _getInfo() methodВидеоUnderstanding WebSocket Data HandlingDIALOGUEReceiving WebSocket Data - AssessmentЗадание
05Sending WebSocket Data13 материалов

Sending WebSocket Data

Getting project files ready to send data to the clientВидеоCalculating the size of the variable-length header fieldВидеоCreate the binary frame buffer blueprintВидеоCreating the first byte of the frameВидеоBitwise shift operatorsВидеоPopulate the frame header with dataВидеоSending the frame to the clientВидеоTesting whether the client received the frameВидеоCreating a reset() functionВидеоUsing debugger tool to examine codeВидеоDisplaying the WebSocket message on the client-sideВидеоCreating and Sending WebSocket FramesDIALOGUESending WebSocket Data - AssessmentЗадание
06Responding to a Closure Frame19 материалов

Responding to a Closure Frame

Setting up project code and defining our mini-goalВидеоClosing handshakeВидеоExtracting the body (closure code and reason) of the close frameВидеоClose Frame StructureВидеоConstruct the payload buffer for the close frameВидеоCompleting and sending the final close frame back to the clientВидеоTesting our codeВидеоUsing Wireshark to master the TCP closure processВидеоChecking for "ping" and "pong" data type, and payloads larger than max sizeВидеоExtracting the server response from the CloseEvent objectВидеоSending a closure frame if the masking bit is not set correctly by the clientВидеоCheck whether client has sent a closure codeВидеоDisplaying default closure message (for normal closure event)ВидеоFixing comments and removing server response text when a new connection is madeВидеоServer side validation for textВидеоFixing the refresh issue killing the serverВидеоResponding to a Closure Frame - AssessmentЗаданиеFull Course Practice AssessmentЗаданиеFull Course AssessmentЗадание