mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 02:46:29 +00:00
perf: replace simple websocket with maintained one (#464)
This commit is contained in:
parent
fc7c2324e8
commit
3f01c29122
@ -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
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user