1 # timed-out [![Build Status](https://travis-ci.org/floatdrop/timed-out.svg?branch=master)](https://travis-ci.org/floatdrop/timed-out)
3 > Timeout HTTP/HTTPS requests
5 Emit Error object with `code` property equal `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged.
10 var get = require('http').get;
11 var timeout = require('timed-out');
13 var req = get('http://www.google.ru');
14 timeout(req, 2000); // Set 2 seconds limit
19 #### timedout(request, time)
24 Type: [`ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest)
26 The request to watch on.
31 Type: `number` or `object`
33 Time in milliseconds to wait for `connect` event on socket and also time to wait on inactive socket.
35 Or you can pass Object with following fields:
37 - `connect` - time to wait for connection
38 - `socket` - time to wait for activity on socket
42 MIT © [Vsevolod Strukchinsky](floatdrop@gmail.com)