Commit Graph

177 Commits

Author SHA1 Message Date
Damien Arrachequesne
cab7db0404 feat: implement the version 4 of the protocol
See https://github.com/socketio/engine.io-protocol for the list of
changes.

Note: The 'base64-arraybuffer' dependency must now be explicitly
included by the client (not needed by the server).
2020-05-19 15:07:53 +02:00
Damien Arrachequesne
415332fc7c test: actually test empty payload handling (#113)
Fixes https://github.com/socketio/engine.io-parser/issues/112
2020-04-15 14:53:41 +02:00
Damien Arrachequesne
7f5a903f91 chore(release): 4.0.0-alpha.0 2020-02-04 12:36:20 +01:00
Damien Arrachequesne
840145d3e5 test: add node.js 12 in the test matrix
See https://github.com/nodejs/Release
2020-01-15 08:52:14 +01:00
Damien Arrachequesne
50853738e0 fix: properly decode binary packets
This fixes the previous commit, allowing to properly decode binary packets in the browser (based on
the binaryType attribute).
2020-01-15 00:00:33 +01:00
Damien Arrachequesne
a947ae59a2 feat: remove packet type when encoding binary packets
Only packets of 'message' type can contain binary data, so it makes sense to remove the prefix in
order to avoid the concatenation of the packet type.

Breaking change: the packet containing binary data will now be sent without any transformation

Protocol v3: { type: 'message', data: <Buffer 01 02 03> } => <Buffer 04 01 02 03>
Protocol v4: { type: 'message', data: <Buffer 01 02 03> } => <Buffer 01 02 03>
2020-01-14 21:54:05 +01:00
Damien Arrachequesne
8eb58a689a refactor: remove Object.keys polyfill
This polyfill is now useless, as we do not plan to support IE < 9 anymore.
2020-01-14 21:54:05 +01:00
Damien Arrachequesne
744bf40d4f refactor: migrate to ES6 syntax and use prettier to format code 2020-01-14 13:28:12 +01:00
Damien Arrachequesne
f1ce1abdbb [chore] Release 2.2.0
Diff: https://github.com/socketio/engine.io-parser/compare/2.1.3...2.2.0
2019-09-13 11:06:09 +02:00
Gaubee
47893e1145 [perf] use Buffer.from instead of manually copying the ArrayBuffer (#108)
Ref: https://nodejs.org/docs/latest/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length
2019-09-13 11:01:01 +02:00
Matthias Ludwig
72f7463be9 [test] fix a typo in the tests (#111)
should encode payloads as string: there is no type 'post'.
2019-09-13 10:50:31 +02:00
Matthias Ludwig
e9a20cb1ca [test] ensure the message packet is properly coerced to string (#110)
result is string '1' not number1
2019-09-13 10:49:08 +02:00
Damien Arrachequesne
569759fc8c [perf] Add a benchmark for encoding / decoding 2019-03-19 23:56:03 +01:00
Damien Arrachequesne
df387fc593 [chore] Update Makefile 2019-03-19 23:56:03 +01:00
Damien Arrachequesne
aedf8eb29e [refactor] Use Buffer.allocUnsafe instead of new Buffer (#104)
Breaking change: drop support for Node.js 4 (since Buffer.allocUnsafe was added in v5.10.0)

Reference: https://nodejs.org/docs/latest/api/buffer.html#buffer_class_method_buffer_allocunsafe_size
2019-03-19 23:56:03 +01:00
Damien Arrachequesne
021a7dc751 [docs] Point the status badge towards the master branch 2018-11-02 06:20:43 +01:00
Damien Arrachequesne
1f2fc43d74 [chore] Release 2.1.3 2018-11-01 06:44:53 +01:00
Amit Portnoy
19694042f5 [chore] Update to blob@0.0.5 (avoid reference to 'global') (#107)
Source: https://github.com/amitport/blob/releases/tag/v0.0.5

Closes #99 
Related https://github.com/socketio/socket.io-client/issues/1166
2018-11-01 06:31:42 +01:00
Damien Arrachequesne
2377dcc613 [fix] Do not mutate the input upon packet encoding (#105)
Fixes #95
2018-11-01 06:26:16 +01:00
Damien Arrachequesne
ebdf467371 [test] Add a basic test for UTF-8 encoding/decoding (#106) 2018-11-01 06:26:13 +01:00
Damien Arrachequesne
e184cac0fa [chore] Pin zuul version
The CI fails with the new version: https://travis-ci.org/socketio/engine.io-parser/jobs/448690970

> /home/travis/build/[secure]io/engine.io-parser/node_modules/zuul/bin/zuul:332
>             throw err.message;
>             ^
> internet explorer@8: [eval("(window.zuul_msg_bus ? window.zuul_msg_bus.splice(0, 1000) : []);")] Not JSON response
2018-10-31 07:50:51 +01:00
Damien Arrachequesne
d848f0fc82 [refactor] Remove any reference to the global variable (#103)
Related #99
2018-10-31 06:23:32 +01:00
Damien Arrachequesne
3bc16f5938 [refactor] Remove custom exports from utf8.js file (#102)
AMD and browser exports are useless here.
2018-10-31 06:23:08 +01:00
Damien Arrachequesne
ecf0c1465c [test] Update travis configuration (#101) 2018-10-31 06:02:03 +01:00
Damien Arrachequesne
916e4bbc45 [chore] Bump dev dependencies (#100) 2018-10-31 06:01:29 +01:00
Damien Arrachequesne
25c4dd115d [test] Update travis configuration 2018-02-27 21:29:29 +01:00
Damien Arrachequesne
e867117708 [chore] Release 2.1.2 2017-12-28 23:05:40 +01:00
Damien Arrachequesne
eeb0653ebb [refactor] Remove useless entry point (#98) 2017-12-28 22:50:15 +01:00
Damien Arrachequesne
275a9cbdb7 [test] Cache node_modules directory (#97) 2017-12-28 22:49:58 +01:00
Damien Arrachequesne
4eb4c9d2e4 [chore] Bump arraybuffer.slice to version 0.0.7 (#96) 2017-12-28 22:49:29 +01:00
Damien Arrachequesne
e2422c300e [chore] Release 2.1.1 2017-04-27 23:05:31 +02:00
Damien Arrachequesne
f5819ccf58 [chore] Bump has-binary2 to version 1.0.2 (#93) 2017-04-27 23:03:54 +02:00
Damien Arrachequesne
2c233681ef [chore] Release 2.1.0 2017-04-24 14:09:33 +02:00
Damien Arrachequesne
5d6ba84292 [chore] Drop support for old nodejs versions (0.10 & 0.12) (#92) 2017-04-24 13:57:00 +02:00
Damien Arrachequesne
bffb63ebfa [revert] "[fix] Enable to utf8-decode string payloads (#88)" (#91)
This reverts commit 278a7e45e7.
2017-04-24 13:53:17 +02:00
Damien Arrachequesne
057f67f2ab [chore] Release 2.0.3 2017-04-05 23:25:16 +02:00
Damien Arrachequesne
528345470c [chore] Use has-binary2 (#90) 2017-04-05 23:17:20 +02:00
Damien Arrachequesne
523dcd2003 [chore] Release 2.0.2 (#89) 2017-03-21 14:40:00 +01:00
Damien Arrachequesne
278a7e45e7 [fix] Enable to utf8-decode string payloads (#88)
That will allow clients receiving the xhr payload with
responseType = 'arraybuffer' to properly decode the message, which is
not sent as binary by the backend anymore since 292c00c (#85).
2017-03-21 14:35:00 +01:00
Damien Arrachequesne
6c597956cb [chore] Release 2.0.1 (#86) 2017-03-06 12:28:04 +01:00
Damien Arrachequesne
292c00c183 [fix] Encode string payloads as strings even if binary supported (#85)
This reverts commit 44c7aa5, which caused string payloads to be encoded
as binary (so that huge string payloads were needlessly UTF-8-encoded).

Related: https://github.com/socketio/socket.io/issues/2872
2017-03-06 12:24:11 +01:00
Damien Arrachequesne
36ba01da98 [chore] release 2.0.0 2016-12-23 11:06:36 +01:00
Gatsbill
89a465a4b8 [perf] Micro optimisations (#84) 2016-12-23 07:19:13 +01:00
Damien Arrachequesne
d1c2680ca9 [fix] Sanitize strings by removing lone surrogates (#82) 2016-12-21 22:01:19 +01:00
Billouboq
2d83f9da17 [perf] Use strict equality where possible (#77) 2016-12-21 09:52:23 +01:00
Damien Arrachequesne
ebf92a5097 [style] Minor style changes (#83) 2016-12-21 09:31:14 +01:00
Damien Arrachequesne
181acef657 [fix] Fix double utf8 encoding for payloads (#81) 2016-12-21 09:15:07 +01:00
Damien Arrachequesne
339d367267 [chore] Update zuul config to speed up tests (#76) 2016-12-21 08:59:06 +01:00
Damien Arrachequesne
77975d054a [chore] release 1.3.2 (#79) 2016-12-07 22:21:41 +01:00
Damien Arrachequesne
494eca0be0 [chore] Bump dependencies (#78)
- bump after to version 0.8.2
- bump has-binary to version 0.1.7
- bump mocha to version 3.2.0
- bump zuul to version 3.11.1
2016-12-07 22:15:59 +01:00