Implementing HTTP Clients and Servers in Node.js

Now that you understand the ClientRequest, ServerResponse, and IncomingMessage objects, you are ready to jump in and implement some Node.js HTTP clients and servers. This section guides you through the process of implementing basic HTTP clients and servers in Node.js. You will implement a client and server in each section to see how the two interact.

The examples in the following sections are extremely basic to make it easy for you to grasp the concepts of starting the client/server and then handling the different requests and responses. The examples contain no error handling, no protection against attacks, and not much other functionality. However, these examples provide a good variety of the basic flow and structure required to handle general HTTP requests using the http module.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.39.252