Networking and Streams

3 hours, 7 minutes CC
Networking and Streams

Course Description

You’ll be introduced to the fundamentals of the built-in stream Node.js module, and learn how to code streams using backpressure to combine multiple data sources and sinks for better data processing. Learn how to use curl and netcat, different stream types - readable, writable, transform, duplex - plus write code for TCP, HTTP, and Websocket servers and clients using Node.js. Finally, learn how to build multiplex streams! This course is ideal for moderately experienced engineers who want to learn how to leverage networking fundamentals and protocols to master the art of building streams in Node.js.

This course and others like it are available as part of our Frontend Masters video subscription.

Preview
Close

Course Details

Published: September 13, 2017

Learn Straight from the Experts Who Shape the Modern Web

Your Path to Senior Developer and Beyond
  • 200+ In-depth courses
  • 18 Learning Paths
  • Industry Leading Experts
  • Live Interactive Workshops
Get Unlimited Access Now

Table of Contents

Networking, Servers, and Clients

Section Duration: 41 minutes

Streams

Section Duration: 36 minutes

Stream Types

Section Duration: 32 minutes

Core Streams

Section Duration: 22 minutes

Web Socket

Section Duration: 10 minutes

Stream Modules

Section Duration: 14 minutes
  • collect-stream, from2, and to2
    James reviews modules found to be useful in development: collect-stream for putting streams into an array and performing unit tests; from2 for ready stream with a pull function; and to2 for a writable stream with a write and flush function;
  • duplexify
    James introduces a duplexify, which creates a writeable and readable stream into a single streams2 duplex stream.
  • pump, pumpify, and end-of-stream
    James discusses error propagation and how it leads to server crashes. To contribute to creating stronger streams, James uses the pump module that helps clean up streams to handle errors gracefully. The pumpify module does similar error handling as pump, but also provides a readable and writeable stream. James introduces end-of-stream, which is a node module that calls a callback when a readable/writable/duplex stream has completed or failed.

Remote Procedure Call and Multiplex

Section Duration: 12 minutes
  • rpc-stream
    James introduces Remote Procedure Call (RPC), which is a protocol that one program can use to request a service from a program located on another computer on a network without having to understand the network's details. Then James shows how to set up a simple RPC system.
  • Multiplex
    Due to limitations of the number of streams a browser can have at one time, James reviews how to use multiplex to send many streams over a single stream.

Wrapping Up

Section Duration: 17 minutes

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now