Chapter 5

Networking with Node

IN THIS CHAPTER

Bullet Staying secure while running Node.js

Bullet Making servers with the http module

Bullet Creating and using HTTP requests

Bullet Responding to requests

Bullet Parsing and populating HTTP headers

“Use a personal firewall. Configure it to prevent other computers, networks, and sites from connecting to you, and specify which programs are allowed to connect to the net automatically.”

—KEVIN MITNICK

The ability to make and receive requests and responses using HTTP protocol is Node.js's killer app. Without networking capabilities, and HTTP networking capabilities in particular, Node.js programs would be confined to talking only to you and using only resources that are on your computer.

What makes Node.js so useful is that you can use it to create web servers and application servers. Here are three useful definitions:

  • A server is a program that can be accessed over a network.
  • A web server is a program that can be accessed over a network by using the HTTP protocol.
  • A ...

Get JavaScript All-in-One For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.