This post will be on the node net module that can be used to accomplish tasks involving the tcp protocol rather than http. The net module includes constructors that return insistences of streams that allow for data to be transmitted on a per data chunk basics like that of the createReadStream method in the file system module.
For a basic example of the nodejs net module here is a hello world example of using the create server net meethod to set up a TPC server on localhost at port 8080.
Once this example is up and running I can use a TCP client like telnet to connect to it an sure enough I get the message hello world. However if you do not have a TCP client installed it is also possible to connect to the server with another script so leys look into how to do that as well.
So the socket constructor can be used to connect to a server by creating and instance of socket and then connecting to a server by using the connect method of socket.
So the net module can be used to set up and connect to TCP servers, it is also the base class for the create server constructors used in the http module as well.