diff --git a/example/server/index.js b/example/server/index.js index 4e9b298..1bd5cfd 100644 --- a/example/server/index.js +++ b/example/server/index.js @@ -13,8 +13,8 @@ var httpsServer = https.createServer({ var wss = new WebSocketServer({ server: httpsServer }); -wss.on('connection', function (ws) { - var connectionId = ws.upgradeReq.headers['sec-websocket-key']; +wss.on('connection', function (ws, req) { + var connectionId = req.headers['sec-websocket-key']; var isMaster = false; if (!masterId) { diff --git a/example/server/package-lock.json b/example/server/package-lock.json index 3963313..83e7cf5 100644 --- a/example/server/package-lock.json +++ b/example/server/package-lock.json @@ -1,8 +1,43 @@ { "name": "server", "version": "0.0.1", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "0.0.1", + "license": "ISC", + "dependencies": { + "fs": "*", + "http": "*", + "https": "*", + "ws": "*" + } + }, + "node_modules/fs": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.2.tgz", + "integrity": "sha1-4fJE7zkzwbKmS9R5kTYGDQ9ZFPg=" + }, + "node_modules/http": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/http/-/http-0.0.0.tgz", + "integrity": "sha1-huYybSnF0Dnen6xYSkVon5KfT3I=" + }, + "node_modules/https": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz", + "integrity": "sha1-PDfHrhqO65ZpBKKtHpdaGUt+06Q=" + }, + "node_modules/ws": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz", + "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ==", + "engines": { + "node": ">=8.3.0" + } + } + }, "dependencies": { "fs": { "version": "0.0.2", diff --git a/package-lock.json b/package-lock.json index f02cfac..8e075f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,28 @@ { "name": "ws-audio-api", - "version": "0.1.5", - "lockfileVersion": 1, + "version": "0.2", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "0.2", + "license": "MIT", + "dependencies": { + "uglify-js": "^3.4.5" + } + }, + "node_modules/uglify-js": { + "version": "3.11.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.5.tgz", + "integrity": "sha512-btvv/baMqe7HxP7zJSF7Uc16h1mSfuuSplT0/qdjxseesDU+yYzH33eHBH+eMdeRXwujXspaCTooWHQVVBh09w==", + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + } + }, "dependencies": { "uglify-js": { "version": "3.11.5",