A
A
Alexander Degtyarev2017-04-07 20:48:52
JavaScript
Alexander Degtyarev, 2017-04-07 20:48:52

Is the net module analogous to the http module in nodejs?

What are the differences between these modules, I read the documentation and even tried some examples, but they do not work for me. fall out with an error. So the question is - why use the net module if there is http?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RidgeA, 2017-04-07
@alexdeg

The net module is a module for low-level networking. For example, if you need to send data using your own protocol via TCP. The HTTP protocol is an upper-level protocol over the TCP protocol, the http module uses the net module.

A
Alexander Aksentiev, 2017-04-07
@Sanasol

http protocol.
net network, with which you need to do something yourself, transfer any data, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question