Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 81d0d8d

Browse files
author
Jay Wolfe
committedMar 11, 2019
added access to websocket server configuration for fine grained control
1 parent 68f18dd commit 81d0d8d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎lib/Web.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ function WebBot(configuration) {
1111

1212
controller.excludeFromConversations(['hello', 'welcome_back', 'reconnect']);
1313

14-
controller.openSocketServer = function(server) {
14+
/**
15+
* wsConfiguration is an object that accepts the normal `ws` configuration object
16+
* see `https://github.com/websockets/ws/blob/HEAD/doc/ws.md#new-websocketserveroptions-callback`
17+
*/
18+
controller.openSocketServer = function(server, wsConfiguration = {}) {
1519

1620
// create the socket server along side the existing webserver.
1721
var wss = new WebSocket.Server({
18-
server
22+
server,
23+
...wsConfiguration,
1924
});
2025

2126
// Expose the web socket server object to the controller so it can be used later.

0 commit comments

Comments
 (0)
This repository has been archived.