Commit Graph

344 Commits

Author SHA1 Message Date
James Coglan 03aebd19fb Fix syntax of dependency versions and bump version to 0.7.3 0.7.3 2019-06-13 16:41:26 +01:00
James Coglan 90c8eb4626 Mention license change in the changelog 2019-06-13 11:38:57 +01:00
James Coglan 3f8e7acd39 Bump version to 0.7.2 0.7.2 2019-06-13 07:47:20 +01:00
James Coglan 85709bb915 Cap http-parser-js at version 0.4.10 until https://github.com/creationix/http-parser-js/issues/63 is fixed 2019-06-13 07:37:27 +01:00
James Coglan 998a1725ea Formatting change: {...} should have spaces inside the braces 2019-06-11 15:56:58 +01:00
James Coglan b5ac856443 Bump version to 0.7.1 0.7.1 2019-06-10 12:24:00 +01:00
James Coglan a96b9037d0 Let npm reformat package.json 2019-06-10 12:19:36 +01:00
James Coglan 09dba8ddf6 Change markdown formatting of docs. 2019-05-29 15:39:28 +01:00
James Coglan efb46fb455 Merge remote-tracking branch 'funtaps/regex_fix' 2019-05-29 00:07:17 +01:00
James Coglan 5723676b7b Make the HTTP parser load correctly if process.version is not set, and remove some code that's supporting Node from before v0.6. 2019-05-24 17:45:47 +01:00
James Coglan f27aa59fd8 Use Buffer.write() instead of Buffer.copy() to write strings into buffers. 2019-05-24 17:22:51 +01:00
James Coglan 4b4cb871bb Ignore package-lock.json. 2019-05-24 17:05:08 +01:00
James Coglan d6115554a0 Merge pull request #29 from lpinca/safe-buffer
Avoid using deprecated Buffer API
2019-05-24 17:04:19 +01:00
James Coglan d93d237cbc Update Travis target versions. 2019-05-24 14:49:49 +01:00
James Coglan 54db7a7ecb Switch license to Apache 2.0. 2019-05-24 14:49:28 +01:00
Luigi Pinca 1682df15bf Avoid using deprecated Buffer API
Usage of `Buffer` constructor has been deprecated due to usability
issues that can potentially lead to accidental security issues.

Refs: https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor
Tracking: https://github.com/nodejs/node/issues/19079
2018-03-22 09:49:28 +01:00
Funtov Kirill 0f1ae9c9ae Regex empty match fix 2018-01-23 11:49:53 +03:00
James Coglan 47c5e4d9ee Handle errors in the draft76 handshake by throwing an error that Base.start() will catch, triggering a 400 response. 2017-11-23 08:51:35 +00:00
James Coglan ae30f9952f Bake the isWebSocket() check into the start() method so that if somebody constructs a driver without making that check, the driver will send a 400 response. 2017-11-23 08:30:24 +00:00
James Coglan e260d4d788 If the request headers contain any of the necessary values for Hybi, then use it. i.e. if Sec-WebSocket-Key is present but not Sec-WebSocket-Version, we should still interpret it as a Hybi connection. 2017-11-19 20:03:38 +00:00
James Coglan ab41320a2b Test on Node v9. 2017-11-19 19:47:55 +00:00
James Coglan 287bbe8a7a If any driver fails to generate a handshake response, then send a 400. This means the initial http() method to select a driver doesn't need to contain all the validation logic for all the details of each protocol version, but protocol errors still result in a failed connection. 2017-11-19 19:47:30 +00:00
James Coglan cad92a6e4e Remove redundant request method check from isWebSocket(). 2017-11-19 19:40:22 +00:00
James Coglan 8128bec1e0 Bump version to 0.7.0. 0.7.0 2017-09-11 21:48:56 +01:00
James Coglan 7be31c44e6 Use package.json rather than .npmignore to list files in the package. 2017-09-11 21:44:53 +01:00
James Coglan 09476b8ed8 Add an example of using the client driver with the net module. 2017-08-15 19:19:35 +01:00
James Coglan d3396ace77 Extract the license into its own file. 2017-08-15 18:45:36 +01:00
James Coglan 1967d6bbb8 Rename tcp_server.js to net_server.js. 2017-08-08 23:39:08 +01:00
James Coglan 1325828a9e Add ping/pong events to the API. 2017-08-02 21:57:47 +01:00
James Coglan b82b7fa39a Drop testing for io.js releases, which barely anybody is still using. 2017-08-01 23:48:19 +01:00
James Coglan c5c97bb30b Formatting tweaks to package.json. 2017-08-01 00:49:41 +01:00
James Coglan 9a16e7aa27 Drop Node 0.6 support; it's no longer possible to make it work on Travis because installing a working version of npm is impossible since it depends on osenv, which doesn't work on 0.6. 2017-07-30 20:02:37 +01:00
James Coglan ed1ce79915 Install a ^-compatible npm on Node 0.8. 2017-07-30 19:50:30 +01:00
James Coglan a1f70fb7f7 Test on Node 7 and 8. 2017-07-30 19:36:07 +01:00
James Coglan 751c77aa1d Replace the built-in Node HTTP parser with the http-parser-js package. 2017-07-30 19:34:41 +01:00
James Coglan b76f4e27d0 Correct the HTTP parser magic numbers. The numbers we had were correct for Node 0.12 but not for releases since then. 2017-07-30 19:26:45 +01:00
James Coglan c4494ff88a Bump version to 0.6.5. 0.6.5 2016-05-20 08:41:04 +01:00
James Coglan cfb2a86838 Test on Node 6.0. 2016-04-30 13:08:02 +01:00
James Coglan 6a92cacf62 Apply masking to messages once the payload has been placed in the frame buffer rather than mutating the original message. 2016-04-27 22:28:58 +01:00
James Coglan 2be829546b Bump version to 0.6.4. 0.6.4 2016-01-07 08:58:29 +00:00
James Coglan 7f3bb13b5c In draft-75/76, convert all non-string values to strings before sending. 2016-01-06 23:20:47 +00:00
James Coglan ffa0aa3a8f Convert numbers to strings when sending frames.
In draft-75/76, passing a number to text() or frame() results in the
sender allocating a buffer of that size and sending it to the other
peer, leaking random blocks of memory.

In hybi, a call to text(), binary() or ping() with a number will fail,
because the input is expected to be a buffer and so an internal method
call fails.

Both kinds of driver now convert numbers to strings, which is what
browsers do with calls to send().
2016-01-06 23:12:44 +00:00
James Coglan 7c64c35c74 Create CODE_OF_CONDUCT.md. 2015-11-08 12:16:08 +00:00
James Coglan 10481b81db Bump version to 0.6.3. 0.6.3 2015-11-06 22:16:36 +00:00
James Coglan 5b3c8131c4 Test on Node 5. 2015-11-05 21:22:37 +00:00
James Coglan b0b0d69ce4 Throw a more helpful error if a client driver is created with an invalid URL. 2015-10-17 21:44:36 +01:00
James Coglan 3461e0187b Run tests on major versions of iojs and node 4. 2015-10-17 12:58:10 +01:00
James Coglan 5b59d0fcd8 Use the modulo operator rather than Math.floor() to check whether the draft-76 keys are legit. 2015-10-02 21:35:22 +01:00
James Coglan 68990a260b Close the connection if a draft-76 client sends a Sec-WebSocket-Key header where the numeric value is a non-integer multiple of the number of spaces. 2015-10-01 23:47:15 +01:00
James Coglan fa8b82d424 Bump version to 0.6.2. 0.6.2 2015-07-18 17:40:03 +01:00