Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade the WebSocket libraries #1301

Merged
merged 37 commits into from
Jun 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0fa800a
Dont load disabled protocols
Aschen May 9, 2019
ae349dd
Dont load disabled protocols
Aschen May 10, 2019
f3fb1f6
Merge branch '1-dev' into fix-disabled-protocol-init
Aschen May 10, 2019
9ae4365
[network] HTTP and WebSocket layers refactoring
scottinet May 10, 2019
f65d216
Merge remote-tracking branch 'origin/fix-disabled-protocol-init' into…
scottinet May 10, 2019
9534801
[config] re-disable access logs
scottinet May 10, 2019
5d2e4ed
[wip] precalculating websocket frame
scottinet May 10, 2019
b2fad69
[ws] precompute websocket frames for efficient broadcasting
scottinet May 14, 2019
6f43019
[config] default to silent mode
scottinet May 14, 2019
6e67380
[websocket] clean up
scottinet May 14, 2019
f800dca
[ws] optimize last activity tracker performances
scottinet May 14, 2019
4677e1d
[ws] adapt tests to ws
scottinet May 14, 2019
5817e18
fix tests
Aschen May 14, 2019
61e3425
Merge branch '1-dev' into fix-disabled-protocol-init
scottinet May 14, 2019
6ccfdd5
Merge remote-tracking branch 'origin/fix-disabled-protocol-init' into…
scottinet May 14, 2019
9fc69c2
Merge branch 'fix-disabled-protocol-init' of github.com:kuzzleio/kuzz…
Aschen May 14, 2019
b33a569
Merge remote-tracking branch 'origin/fix-disabled-protocol-init' into…
scottinet May 14, 2019
af5f411
[websocket] emit a PING only if inactive
scottinet May 15, 2019
782fc5f
Merge branch '1-dev' into fix-disabled-protocol-init
benoitvidis May 15, 2019
24e058c
[tests] update tests + bugfixes
scottinet May 15, 2019
be00d61
[package.json] dependencies update
scottinet May 15, 2019
2c3a48a
[tests] moar tests and bugfixes
scottinet May 15, 2019
0c5cd77
[ws] last minute cleanup
scottinet May 16, 2019
18fa313
[bug] fix inverted assert logic
scottinet May 16, 2019
7ca1556
Merge remote-tracking branch 'origin/fix-disabled-protocol-init' into…
scottinet May 16, 2019
e3a1571
[ws] in hindsight, idle sweeps should be made more often
scottinet May 16, 2019
2bd3bcf
Update lib/api/core/entrypoints/embedded/protocols/http.js
scottinet May 16, 2019
1efa47c
[protocols] DRYify configuration
scottinet May 17, 2019
a782f61
Merge branch '1-dev' into migrate-to-ws
scottinet May 20, 2019
70066aa
[compat] downgrade ws to v6.2.1 to make it work with Node.js 6
scottinet May 20, 2019
087d134
Merge branch 'migrate-to-ws' of github.com:kuzzleio/kuzzle into migra…
scottinet May 20, 2019
f266ff6
Merge remote-tracking branch 'origin/1-dev' into migrate-to-ws
scottinet May 20, 2019
e3eed22
[bug] fix doubled assert declaration (bad merge)
scottinet May 20, 2019
fadbf09
Merge branch '1-dev' into migrate-to-ws
scottinet May 23, 2019
4d1af27
Merge branch '1-dev' into migrate-to-ws
scottinet May 28, 2019
eee6882
Merge remote-tracking branch 'origin/1-dev' into migrate-to-ws
scottinet May 28, 2019
4ec0b96
[merge] fix bad merge state
scottinet May 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .kuzzlerc.sample
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,25 @@
"websocket": {
// * enabled:
// Set to true to enable WebSocket support
// * idleTimeout:
// The maximum time (in milliseconds) without sending or receiving a
// message from a client. Once reached, the client's socket is
// forcibly closed.
// Contrary to heartbeats (see below), this is a passive check,
// forcing all clients to actively send either PINGs or messages to
// maintain their connection active.
// Set the value to 0 to disable this feature (should only be
// activated if heartbeat is disabled)
// * heartbeat:
// The time, in milliseconds, between the server's PING requests.
// Setting this value to 0 disables PING/PONG requests entirely.
// The time, in milliseconds, between the server's PING requests to
// clients, to make sure they are still active.
// Setting this value to 0 disables PING requests from the server
// (it will still respond with a PONG to PING requests from clients).
// If heartbeat is deactivated, then setting a non-zero value to
// idleTimeout is strongly recommended to detect and remove
// dead sockets.
"enabled": true,
"idleTimeout": 0,
"heartbeat": 60000
}
}
Expand Down
1 change: 1 addition & 0 deletions default.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ module.exports = {
},
websocket: {
enabled: true,
idleTimeout: 0,
heartbeat: 60000
}
}
Expand Down
2 changes: 1 addition & 1 deletion features/support/api/websocket.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const
Bluebird = require('bluebird'),
WsApiBase = require('./websocketBase'),
Ws = require('uws');
Ws = require('ws');

class WebSocketApi extends WsApiBase {

Expand Down
2 changes: 1 addition & 1 deletion lib/api/core/entrypoints/embedded/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ class EmbeddedEntryPoint extends EntryPoint {
protocol.broadcast(this.constructor._removeErrorStack(data));
}
catch (e) {
this.kuzzle.emit('log:error', `[broadcast] protocol ${protoKey} failed: ${e.message}`);
this.kuzzle.emit('log:error', `[broadcast] protocol ${protoKey} failed: ${e.message}\n${e.stack}`);
}
}
}
Expand Down
Loading