Chapter 7. Networking: Node’s true “Hello, World”

 

This chapter covers

  • Networking concepts and how they relate to Node
  • TCP, UDP, and HTTP clients and servers
  • DNS
  • Network encryption

The Node.js platform itself is billed as a solution for writing fast and scalable network applications. To write network-oriented software, you need to understand how networking technologies and protocols interrelate. Over the course of the next section, we explain how networks have been designed around technology stacks with clear boundaries; and furthermore, how Node implements these protocols and what their APIs look like.

In this chapter you’ll learn about how Node’s networking modules work. This includes the dgram, dns, http, and net modules. If you’re unsure about network terminology like socket, packet, and protocol, then don’t worry: we also introduce key networking concepts to give you a solid foundation in network programming.

7.1. Networking in Node

This section is an introduction to networking. You’ll learn about network layers, packets, sockets—all of the stuff that networks are made of. These ideas are critical to understanding Node’s networking APIs.

7.1.1. Networking terminology

Networking jargon can quickly become overwhelming. To get everyone on the same page, we’ve included table 7.1, which summarizes the main concepts that will form the basis of this chapter.

7.2. TCP clients and servers

7.3. UDP clients and servers

7.4. HTTP clients and servers

7.5. Making DNS requests

7.6. Encryption

7.7. Summary

sitemap