question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'timeout' option differs from Node.js

See original GitHub issue

@connor4312’s PR https://github.com/jhiesey/stream-http/pull/55 added a ‘timeout’ option, but it’s behavior differs from the Node.js behavior.

In Node.js the connection is not closed when the timeout occurs, only a ‘timeout’ event is fired. However, setting the xhr.timeout property actually does kill the connection.

xhr.timeout: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout request.setTimeout: https://nodejs.org/api/http.html#http_request_settimeout_timeout_callback

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ferosscommented, Jan 15, 2017

Most users probably want the connection killed after a timeout occurs. No idea why the Node.js API doesn’t do that. Still, the point of this package is to match the Node.js API and any divergence will just introduce confusion.

0reactions
jhieseycommented, Jan 15, 2018

Since it isn’t really possible to match node’s behavior properly in the browser, I’m just going to rename the broken timeout option to requestTimeout.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Complete Guide to Timeouts in Node.js - Better Stack
Node.js exposes a server.timeout property that determines the amount of inactivity on a connection socket before it is assumed to have timed out ......
Read more >
Difference between keepAliveTimeout and timeout?
timeout? It sounds like they are both about socket timeout which only start to tick on inactivity. node.js.
Read more >
Timers in Node.js
The Timeout object provides two functions intended to augment Timeout behavior with unref() and ref() . If there is a Timeout object scheduled...
Read more >
Using setTimeout() and other timer APIs in Node.js
Timers are used in Node.js to execute a function at a certain time. Explore setTimeout(), clearTimeout(), and other Node.js timer functions.
Read more >
https.request timeout options doesn't work #23282 - GitHub
Node version 8.11.3. 64-bit Windows 8.1 As I understood from docs, timeout property in https.request options sets socket connection timeout.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found