diff --git a/cometd-nodejs-client.js b/cometd-nodejs-client.js index 4bdcc2f..73ad541 100644 --- a/cometd-nodejs-client.js +++ b/cometd-nodejs-client.js @@ -154,5 +154,8 @@ module.exports = { window.XMLHttpRequest.HEADERS_RECEIVED = 2; window.XMLHttpRequest.LOADING = 3; window.XMLHttpRequest.DONE = 4; + + // WebSocket support + window.WebSocket = require('ws'); } }; diff --git a/package.json b/package.json index 3b5ac08..5a09567 100644 --- a/package.json +++ b/package.json @@ -22,5 +22,8 @@ }, "devDependencies": { "mocha": "*" + }, + "dependencies": { + "ws": "^6.0.0" } }