From fddbde2fd5327465a5c553532d1eb13886cc9e3e Mon Sep 17 00:00:00 2001 From: "ali.ibrahim" Date: Wed, 19 Oct 2016 18:19:28 +0200 Subject: [PATCH] Documenting net module: various fixes. --- docs/api/net.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/api/net.md b/docs/api/net.md index 8570fe4103..34cffd63d5 100644 --- a/docs/api/net.md +++ b/docs/api/net.md @@ -4,15 +4,19 @@ The `net` module is a client-side API for issuing HTTP(S) requests. It is similar to the [HTTP](https://nodejs.org/api/http.html) and [HTTPS](https://nodejs.org/api/https.html) modules of Node.js -but uses Chromium networking library instead of the Node.js stack offering therefore a much grater support regarding web proxies. +but it uses Chromium native networking library instead of the Node.js implementation offering +therefore a much greater support regarding web proxies. -Following is a non-exhaustive list of why you may need to use the `net` module instead of Node.js [HTTP](https://nodejs.org/api/http.html): +Following is a non-exhaustive list of why you may consider using the `net` module instead of the native Node.js modules: * Automatic management of system proxy configuration, support of the wpad protocol and proxy pac configuration files. * Automatic tunneling of HTTPS requests. * Support for authenticating proxies using basic, digest, NTLM, Kerberos or negotiate authentication schemes. * Support for traffic monitoring proxies: Fiddler-like proxies used for access control and monitoring. -The following example quickly shows how the `net` API mgiht be used: +The `net` module API has been specifically designed to mimic, as much closely as possible, the familiar Node.js API. +The API components including classes, methods, properties and event names are similar to those commonly used in Node.js. + +For instance, the following example quickly shows how the `net` API might be used: ```javascript const {app} = require('electron') @@ -42,6 +46,9 @@ app.on('ready', () => { }) ``` +By the way, it is almost identical to the way you would normally use the +[HTTP](https://nodejs.org/api/http.html)/[HTTPS](https://nodejs.org/api/https.html) modules of Node.js + ## Methods The `net` module has the following methods: @@ -52,7 +59,8 @@ The `net` module has the following methods: Returns `ClientRequest` -Create a `ClientRequest` instance using the provided `options` object. +Create a `ClientRequest` instance using the provided `options` object which is directly +passed to the `ClientRequest` constructor. ## Class: ClientRequest