-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
req.destroy / req.abort does not close the underlying connection #26
Comments
In Chrome, you're likely using the WHATWG Fetch API, which currently has no way to signal an abort. See this thread: whatwg/fetch#27 |
Yeah, this is a limitation of the Fetch API. Once there's support for aborting a request, we'll add support to stream-http and your server load will be magically reduced :) |
Thanks for your very quick replies :-) Do you know of any timeframe that we're talking about here? Is this something that is probably going to happen in the near future, or will it take its time (weeks, months, years)? |
I would guess months. It depends on it being spec'd out and implemented by browsers, so it could turn out to be years if they don't get their act together. I asked on Twitter: https://twitter.com/feross/status/646011172970299392 @jhiesey would be able to tell you if there's an option you can pass to force stream-http to use XHR instead of Fetch so you'll get support for abort. |
Thanks a lot for the detailed answer :-)) |
There isn't currently an option to force XHR instead of Fetch, but I agree it sounds like a good idea. Pull request welcome! Otherwise I'll add it myself sometime soon. |
Being able to force this mode somehow is one thing, but how would you switch into this mode when using stream-http within browserify? |
@goloroden As long as you are using If on the other hand you are using another module that in turn requires |
If you have an open request and call
req.destroy()
, you won't get data any longer, but the connection stays open (at least in Chrome).So, for the server-side, there is no way to detect that the client is not interested any more in the server's data and can therefor not clean up afterwards :-(
What should I do to handle this?
The text was updated successfully, but these errors were encountered: