Consider ability to set a timeout
hunterloftis opened this issue · 2 comments
hunterloftis commented
Lovely little library! It would be fantastic to be able to set a timeout for requests, which currently is impossible (no way to call request.setTimeout
since the request instance is not returned to the user).
matjaz commented
options.timeout: ms
would be obvious, but what about other ClientRequest
methods?
Maybe something like
http.get({
...
request: (request) {
request.setTimeout...
}
})
With this, user can also hook into events.
Thanks!
hunterloftis commented
A hook that passes the request instance sounds like a great solution to me.