From df67d09914d531b34b50660fe8181f854cb2dd4d Mon Sep 17 00:00:00 2001 From: Aaron Hung Date: Mon, 10 Sep 2018 16:58:05 -0400 Subject: [PATCH] Issue #9: WebSocket Support Adds WebSocket support for the client using the ws package. --- cometd-nodejs-client.js | 3 +++ package.json | 3 +++ 2 files changed, 6 insertions(+) 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" } }