bufix: send xml before http.Server closes the socket#8
Open
chatziko wants to merge 6 commits into3rd-Eden:masterfrom
Open
bufix: send xml before http.Server closes the socket#8chatziko wants to merge 6 commits into3rd-Eden:masterfrom
chatziko wants to merge 6 commits into3rd-Eden:masterfrom
Conversation
In some versions of node.js (tested with v0.12.7) the http.Server class closes the socket immediately when it sees that the request is not HTTP, before we manage to send the xml! So we need to make sure that our connection listener is executed _first_. To do so we remove them all and we re-add them.
When SecureSocket is used, flash requests the policy file over the TLS encrypted socket. By passing an https server to policyfile we can answer such policy requests inline.
For some reason the data event handler was not being called. We now do the trick of removing/inserting all handlers for the data event, instead of the connection event.
process.EventEmitter is deprecated. use require('events') instead
Update server.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some versions of node.js (tested with v0.12.7) the http.Server class closes
the socket immediately when it sees that the request is not HTTP, before we
manage to send the xml! So we need to make sure that our connection listener is
executed first. To do so we remove them all and we re-add them.
The 'inline response http' fails on node v0.12.7, it passes after the fix.