998a1725ea
Formatting change: {...} should have spaces inside the braces
James Coglan
2019-06-11 15:56:58 +01:00
b5ac856443
Bump version to 0.7.1
0.7.1
James Coglan
2019-06-10 12:24:00 +01:00
a96b9037d0
Let npm reformat package.json
James Coglan
2019-06-10 12:19:36 +01:00
09dba8ddf6
Change markdown formatting of docs.
James Coglan
2019-05-29 15:39:28 +01:00
efb46fb455
Merge remote-tracking branch 'funtaps/regex_fix'
James Coglan
2019-05-29 00:07:17 +01:00
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.
James Coglan
2019-05-24 17:45:47 +01:00
f27aa59fd8
Use Buffer.write() instead of Buffer.copy() to write strings into buffers.
James Coglan
2019-05-24 17:22:51 +01:00
4b4cb871bb
Ignore package-lock.json.
James Coglan
2019-05-24 15:03:16 +01:00
d6115554a0
Merge pull request #29 from lpinca/safe-buffer
James Coglan
2019-05-24 17:04:19 +01:00
d93d237cbc
Update Travis target versions.
James Coglan
2019-05-24 14:49:49 +01:00
54db7a7ecb
Switch license to Apache 2.0.
James Coglan
2019-05-24 14:49:28 +01:00
1682df15bf
Avoid using deprecated Buffer API
Luigi Pinca
2018-03-22 09:49:28 +01:00
0f1ae9c9ae
Regex empty match fix
Funtov Kirill
2017-12-29 17:29:44 +03:00
47c5e4d9ee
Handle errors in the draft76 handshake by throwing an error that Base.start() will catch, triggering a 400 response.
James Coglan
2017-11-23 08:51:35 +00:00
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.
James Coglan
2017-11-23 08:29:57 +00:00
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.
James Coglan
2017-11-19 20:03:38 +00:00
ab41320a2b
Test on Node v9.
James Coglan
2017-11-19 19:47:55 +00:00
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.
James Coglan
2017-11-19 19:47:30 +00:00
cad92a6e4e
Remove redundant request method check from isWebSocket().
James Coglan
2017-11-19 19:40:22 +00:00
569ec1d62e
Perform more stringent checks on request headers so that it should not be possible to get a driver for requests with invalid headers.
request-validation
James Coglan
2017-10-30 22:53:34 +00:00
8128bec1e0
Bump version to 0.7.0.
0.7.0
James Coglan
2017-09-11 21:48:56 +01:00
7be31c44e6
Use package.json rather than .npmignore to list files in the package.
James Coglan
2017-09-11 21:44:53 +01:00
09476b8ed8
Add an example of using the client driver with the net module.
James Coglan
2017-08-15 19:19:35 +01:00
d3396ace77
Extract the license into its own file.
James Coglan
2017-08-15 18:45:36 +01:00
1967d6bbb8
Rename tcp_server.js to net_server.js.
James Coglan
2017-08-08 23:39:08 +01:00
1325828a9e
Add ping/pong events to the API.
James Coglan
2017-08-02 21:57:47 +01:00
b82b7fa39a
Drop testing for io.js releases, which barely anybody is still using.
James Coglan
2017-08-01 23:48:19 +01:00
c5c97bb30b
Formatting tweaks to package.json.
James Coglan
2017-08-01 00:45:33 +01:00
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.
James Coglan
2017-07-30 20:02:37 +01:00
ed1ce79915
Install a ^-compatible npm on Node 0.8.
James Coglan
2017-07-30 19:40:09 +01:00
a1f70fb7f7
Test on Node 7 and 8.
James Coglan
2017-07-30 19:36:07 +01:00
751c77aa1d
Replace the built-in Node HTTP parser with the http-parser-js package.
James Coglan
2017-07-30 19:34:41 +01:00
b76f4e27d0
Correct the HTTP parser magic numbers. The numbers we had were correct for Node 0.12 but not for releases since then.
James Coglan
2017-07-30 19:26:45 +01:00
c4494ff88a
Bump version to 0.6.5.
0.6.5
James Coglan
2016-05-20 08:41:04 +01:00
cfb2a86838
Test on Node 6.0.
James Coglan
2016-04-30 13:08:02 +01:00
6a92cacf62
Apply masking to messages once the payload has been placed in the frame buffer rather than mutating the original message.
James Coglan
2016-04-27 22:28:58 +01:00
2be829546b
Bump version to 0.6.4.
0.6.4
James Coglan
2016-01-07 08:58:29 +00:00
7f3bb13b5c
In draft-75/76, convert all non-string values to strings before sending.
James Coglan
2016-01-06 23:20:47 +00:00
ffa0aa3a8f
Convert numbers to strings when sending frames.
James Coglan
2016-01-06 23:12:44 +00:00
7c64c35c74
Create CODE_OF_CONDUCT.md.
James Coglan
2015-11-08 12:16:08 +00:00
10481b81db
Bump version to 0.6.3.
0.6.3
James Coglan
2015-11-06 22:16:36 +00:00
5b3c8131c4
Test on Node 5.
James Coglan
2015-11-05 21:22:37 +00:00
b0b0d69ce4
Throw a more helpful error if a client driver is created with an invalid URL.
James Coglan
2015-10-17 21:44:36 +01:00
3461e0187b
Run tests on major versions of iojs and node 4.
James Coglan
2015-10-17 12:57:58 +01:00
5b59d0fcd8
Use the modulo operator rather than Math.floor() to check whether the draft-76 keys are legit.
James Coglan
2015-10-02 21:35:22 +01:00
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.
James Coglan
2015-10-01 23:47:15 +01:00
fa8b82d424
Bump version to 0.6.2.
0.6.2
James Coglan
2015-07-18 17:40:03 +01:00
89e2a7da82
Emit a protocol error when a closing frame has a 1-byte payload.
James Coglan
2015-07-17 22:05:26 +01:00
70ef5440c4
Emit close code 1000 if the closing frame does not contain one.
James Coglan
2015-07-15 18:04:02 +01:00
c84cce9a1f
Bump version to 0.6.1.
0.6.1
James Coglan
2015-07-13 20:13:20 +01:00
c8e5f1eb78
A few stylistic tweaks.
James Coglan
2015-07-11 14:24:27 +01:00
eb5e39e7e3
Standardise the words used to refer to chunks of parser input.
James Coglan
2015-07-10 22:37:54 +01:00
a95f68080e
Use the buffer.{read,write}UInt{16,32}BE functions to parse and write numbers rather than implementing such things ourselves.
James Coglan
2015-07-10 19:57:12 +01:00
7a1cb15b8c
Bump version to 0.6.0.
0.6.0
James Coglan
2015-07-08 20:17:01 +01:00
14937dd365
Emit an error event *after* setting the ready state to 3.
James Coglan
2015-07-08 20:14:14 +01:00
780dd331fe
The 'connect' event should emit a ConnectEvent object.
James Coglan
2015-07-07 21:33:15 +01:00
4a3d51cc5b
Incorporate StreamReader into Draft75 so that it retains input and recovers safely from exceptions in event listeners.
James Coglan
2015-07-07 21:30:06 +01:00
ed17186354
In the Hybi driver, perform parser state changes before validating and emitting events. This protects the parser against errors thrown by event listeners.
James Coglan
2015-07-07 20:30:45 +01:00
1df1293456
Change stage in the Base.shutdown() method to that all parsers stop processing input.
James Coglan
2015-07-04 21:07:34 +01:00
d901d3e48d
If an event listener emits an error, close the connection with code 1011.
James Coglan
2015-07-04 20:54:22 +01:00
a49cd60cb7
Document that on() *adds* a callback, rather than *setting* one, i.e. it does not remove any prior callbacks.
James Coglan
2015-07-04 19:31:36 +01:00
4dd872f0ef
Add the pong() command to the documentation.
James Coglan
2015-07-04 18:50:55 +01:00
c3ac50931e
Implement unit tests for pong method
Victor Gama
2015-02-20 23:52:09 -02:00
5f6873ebc0
Ensure message is always defined
Victor Gama
2015-02-20 21:37:18 -02:00
309b5651a7
Implement 'pong' command to hybi.js
Victor Gama
2015-02-20 21:33:07 -02:00
1cc0f33e1c
Update the changelog for 0.5.4.
0.5.4
James Coglan
2015-03-29 23:13:10 +01:00
b273147f0c
Replace 'iff' with 'if and only if'.
James Coglan
2015-03-28 19:44:10 +00:00
d1796bef12
Use require('..') to import this module in examples.
James Coglan
2015-03-28 09:47:59 +00:00
0034f5fe19
Fail the connection when the server receives an invalid Sec-WebSocket-Extensions header.
James Coglan
2015-03-26 08:51:34 +00:00
09f638893e
Bump version to 0.5.4.
James Coglan
2015-03-12 12:59:53 +00:00
8a0235ef51
Don't send a close frame in response to receiving one, if we already sent a close frame.
James Coglan
2015-03-12 12:58:43 +00:00
2b99c23788
Bump version to 0.5.3.
0.5.3
James Coglan
2015-02-22 21:04:03 +00:00
23d0a9ea5e
Don't parse incoming data if the client is already closed. This stops the headers being interpreted as WebSocket data if the client is closed before receiving the server's handshake. Fixes https://github.com/faye/websocket-extensions-node/issues/1.
James Coglan
2015-02-21 12:34:37 +00:00
0b7eedc3b5
Bump version to 0.5.2.
0.5.2
James Coglan
2015-02-19 09:42:57 +00:00
201e3dd7c5
Test on Node 0.12 and io.js.
James Coglan
2015-02-19 09:26:06 +00:00
ebe4ce1382
Because Driver.frame() will now admit input when in readyState 2 (to allow for async extension shutdown), the Messages stream should use the text() and binary() methods that will block messages in that state.
James Coglan
2015-02-16 09:51:40 +00:00
daa37974c6
Don't emit further error/close events if the driver is already closing.
James Coglan
2015-02-16 09:08:10 +00:00
cc5e5c245e
Use Extensions.close(callback) to make sure close follows all pending messages.
James Coglan
2015-02-15 13:18:21 +00:00
bdc081ab57
Adapt to the changes to the HTTPParser API introduced in iojs.
James Coglan
2015-02-02 21:06:51 +00:00
57e74231cf
Bump version to 0.5.1.
0.5.1
James Coglan
2014-12-18 02:19:26 +00:00
5cba268409
Throw an error if drivers are created with unrecognised options.
James Coglan
2014-12-17 22:12:56 +00:00
e8992add23
Bump version to 0.5.0 and document how to add extensions.
0.5.0
James Coglan
2014-12-13 13:00:47 +00:00
23675e08ee
Don't expose the internal frame structure of messages to extensions; they should not be able to depend on seeing the actual frame boundaries off the wire because that requires all extensions to leave them intact.
James Coglan
2014-12-06 22:08:37 +00:00
66f46330e7
Remove some blank lines.
James Coglan
2014-12-05 19:36:06 +00:00
7376f48d6a
Catch errors raised by Extensions.activate().
James Coglan
2014-12-02 22:53:16 +00:00
330fa2073d
Don't assume that messages coming out of extensions have anything but the standard websocket-extensions API.
James Coglan
2014-11-29 01:54:20 +00:00