agent.maxSockets

agent.maxSockets By default set to Infinity. Determines how many concurrent sockets the agent can have open per origin. Origin is either a 'host:port' or 'host:port:localAddress' combination.

http_server.setTimeout()

server.setTimeout(msecs, callback) msecs <Number> callback <Function> Sets the timeout value for sockets, and emits a 'timeout' event on the Server object, passing the socket as an argument, if a timeout occurs. If there is a 'timeout' event listener on the Server object, then it will be called with the timed-out socket as an argument. By default, the Server's timeout value is 2 minutes, and sockets are destroyed automatically if they time out. However, if you assign a callb

readable.unshift()

Stability: 2 - Stable A stream is an abstract interface implemented by various objects in Node.js. For example a request to an HTTP server is a stream, as is process.stdout. Streams are readable, writable, or both. All streams are instances of EventEmitter. You can load the Stream base classes by doing require('stream'). There are base classes provided for Readable streams, Writable streams, Duplex streams, and Transform streams. This document is split up into 3 sections: The first section e

error event (dgram.Socket)

Event: 'error' exception <Error> The 'error' event is emitted whenever any error occurs. The event handler function is passed a single Error object.

http.ClientRequest

Class: http.ClientRequest This object is created internally and returned from http.request(). It represents an in-progress request whose header has already been queued. The header is still mutable using the setHeader(name, value), getHeader(name), removeHeader(name) API. The actual header will be sent along with the first data chunk or when closing the connection. To get the response, add a listener for 'response' to the request object. 'response' will be emitted from the request object when t

message.headers

message.headers The request/response headers object. Key-value pairs of header names and values. Header names are lower-cased. Example: // Prints something like: // // { 'user-agent': 'curl/7.22.0', // host: '127.0.0.1:8000', // accept: '*/*' } console.log(request.headers); Duplicates in raw headers are handled in the following ways, depending on the header name: Duplicates of age, authorization, content-length, content-type, etag, expires, from, host, if-modified-since, if-unmodified-si

net_socket.write()

socket.write(data[, encoding][, callback]) Sends data on the socket. The second parameter specifies the encoding in the case of a string--it defaults to UTF8 encoding. Returns true if the entire data was flushed successfully to the kernel buffer. Returns false if all or part of the data was queued in user memory. 'drain' will be emitted when the buffer is again free. The optional callback parameter will be executed when the data is finally written out - this may not be immediately.

readable.pipe()

Stability: 2 - Stable A stream is an abstract interface implemented by various objects in Node.js. For example a request to an HTTP server is a stream, as is process.stdout. Streams are readable, writable, or both. All streams are instances of EventEmitter. You can load the Stream base classes by doing require('stream'). There are base classes provided for Readable streams, Writable streams, Duplex streams, and Transform streams. This document is split up into 3 sections: The first section e

net_socket.setNoDelay()

socket.setNoDelay([noDelay]) Disables the Nagle algorithm. By default TCP connections use the Nagle algorithm, they buffer data before sending it off. Setting true for noDelay will immediately fire off data each time socket.write() is called. noDelay defaults to true. Returns socket.

data event (net.Socket)

Event: 'data' <Buffer> Emitted when data is received. The argument data will be a Buffer or String. Encoding of data is set by socket.setEncoding(). (See the Readable Stream section for more information.) Note that the data will be lost if there is no listener when a Socket emits a 'data' event.