diff --git a/package.json b/package.json index 90099e4..3d69b4f 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "socks": "^2.0.0", "string2compact": "^2.0.0", "unordered-array-remove": "^1.0.2", - "ws": "^7.4.5" + "ws": "^8.0.0" }, "devDependencies": { "@mapbox/node-pre-gyp": "1.0.10", diff --git a/server.js b/server.js index 05364e8..dd823f4 100644 --- a/server.js +++ b/server.js @@ -6,7 +6,7 @@ import http from 'http' import peerid from 'bittorrent-peerid' import series from 'run-series' import string2compact from 'string2compact' -import ws from 'ws' +import { WebSocketServer } from 'ws' import common from './lib/common.js' import Swarm from './lib/server/swarm.js' @@ -14,7 +14,6 @@ import parseHttpRequest from './lib/server/parse-http.js' import parseUdpRequest from './lib/server/parse-udp.js' import parseWebSocketRequest from './lib/server/parse-websocket.js' -const { Server: WebSocketServer } = ws const debug = Debug('bittorrent-tracker:server') const hasOwnProperty = Object.prototype.hasOwnProperty