This chapter describes the application of network services from the perspective of Nodejs-owned modules:
NET-----> TCP
Dgram to UDP
HTTP-----> HTTP
HTTPS----> HTTPS
From the angle of these four modules, the application of the network in the server is described.
Simulates sending and receiving requests from the server-side and client perspective of creating services.
One of the most beneficial should be WebSocket that chapter, have not heard this agreement, later read this book, asked the next Niang, just know:
This protocol is a new protocol based on HTML5, it supports the server side to create a long connection with the client, do not need to shake hands multiple times, also can implement server-side push function, because it is full-duplex communication mode, so the server can also send a request to the client, the client can also be the corresponding server side at any time. This opens the door to applications that need to be pushed, and the most typical application scenario is the chat room ....
Nodejs Network Services