-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move binary detection back to the parser
The binary detection was moved from the parser to the client/server in [1], in order to allow the user to skip the binary detection for huge JSON payloads. ```js socket.binary(false).emit(...); ``` The binary detection is needed in the default parser, because the payload is encoded with JSON.stringify(), which does not support binary content (ArrayBuffer, Blob, ...). But other parsers (like [2] or [3]) do not need this check, so we'll move the binary detection back here and remove the socket.binary() method, as this use case is now covered by the ability to provide your own parser. Note: the hasBinary method was copied from [4]. [1]: f44256c [2]: https://github.com/darrachequesne/socket.io-msgpack-parser [3]: https://github.com/darrachequesne/socket.io-json-parser [4]: https://github.com/darrachequesne/has-binary
- Loading branch information
1 parent
7fc3c42
commit 285e7cd
Showing
7 changed files
with
59 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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