Skip to content
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

Should we also send "Connection: Close" ? #21

Open
billywhizz opened this issue Nov 2, 2018 · 2 comments
Open

Should we also send "Connection: Close" ? #21

billywhizz opened this issue Nov 2, 2018 · 2 comments

Comments

@billywhizz
Copy link

Hi, This module seems to do everything the correct way but I wonder would it be more correct to also send the "Connection: Close" header to the client on the last inflight request before closing the socket? Otherwise we will end "Connection: Keep-Alive" back and the client will not be expecting the socket to close.

i.e. the logic would go here: https://github.com/hunterloftis/stoppable/blob/master/lib/stoppable.js#L27

@ronkorving
Copy link

I think the client should always expect a socket to close (HTTP is a network protocol after all). Every keep-alive connection ends sooner or later. I don't think you're obligated to change to connection: close when you do (headers and payload may have already been sent before you decide to close for example). But that's just me. Is there any literature on the topic that implies that this is a good idea?

@boneskull
Copy link
Collaborator

@billywhizz Do you have a use case for this behavior?

If not, I'd prefer not to make theoretical changes... 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants