VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-http-clientrequest-reusedsocket-property/

⇱ Node.js http.ClientRequest.reusedSocket Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js http.ClientRequest.reusedSocket Property

Last Updated : 27 Jan, 2023

The http.ClientRequest.reusedSocket is an inbuilt application programming interface of class ClientRequest within the HTTP module which is used to check if the request is sent through a reused socket.

Syntax:

const request.reusedSocket

Parameters: This property does not accept any argument as a parameter.

Return Value: This property returns the object of the client request-host.

Example 1: Filename-index.js

Run the index.js file using the following command:

node index.js

Output:

message is not sent through reusedSocket

Example 2: Filename-index.js

Run the index.js file using the following command:

node index.js

Output:

message is not sent through reusedSocket

Reference: https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_request_reusedsocket

Comment

Explore