perf: replace simple websocket with maintained one (#464)

This commit is contained in:
Cas 2023-05-25 19:18:36 +02:00 committed by GitHub
parent fc7c2324e8
commit 3f01c29122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@ import clone from 'clone'
import Debug from 'debug'
import Peer from 'simple-peer'
import randombytes from 'randombytes'
import Socket from 'simple-websocket'
import Socket from '@thaunknown/simple-websocket'
import Socks from 'socks'
import common from '../common.js'
@ -214,7 +214,7 @@ class WebSocketTracker extends Tracker {
this.expectingResponse = false
try {
data = JSON.parse(data)
data = JSON.parse(Buffer.from(data))
} catch (err) {
this.client.emit('warning', new Error('Invalid tracker response'))
return

View File

@ -27,6 +27,7 @@
},
"type": "module",
"dependencies": {
"@thaunknown/simple-websocket": "^9.1.0",
"bencode": "^3.0.3",
"bittorrent-peerid": "^1.3.3",
"bn.js": "^5.2.0",
@ -45,7 +46,6 @@
"run-series": "^1.1.9",
"simple-get": "^4.0.0",
"simple-peer": "^9.11.0",
"simple-websocket": "^9.1.0",
"socks": "^2.0.0",
"string2compact": "^2.0.0",
"unordered-array-remove": "^1.0.2",