mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 19:06:27 +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 Debug from 'debug'
|
||||||
import Peer from 'simple-peer'
|
import Peer from 'simple-peer'
|
||||||
import randombytes from 'randombytes'
|
import randombytes from 'randombytes'
|
||||||
import Socket from 'simple-websocket'
|
import Socket from '@thaunknown/simple-websocket'
|
||||||
import Socks from 'socks'
|
import Socks from 'socks'
|
||||||
|
|
||||||
import common from '../common.js'
|
import common from '../common.js'
|
||||||
@ -214,7 +214,7 @@ class WebSocketTracker extends Tracker {
|
|||||||
this.expectingResponse = false
|
this.expectingResponse = false
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(data)
|
data = JSON.parse(Buffer.from(data))
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.client.emit('warning', new Error('Invalid tracker response'))
|
this.client.emit('warning', new Error('Invalid tracker response'))
|
||||||
return
|
return
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@thaunknown/simple-websocket": "^9.1.0",
|
||||||
"bencode": "^3.0.3",
|
"bencode": "^3.0.3",
|
||||||
"bittorrent-peerid": "^1.3.3",
|
"bittorrent-peerid": "^1.3.3",
|
||||||
"bn.js": "^5.2.0",
|
"bn.js": "^5.2.0",
|
||||||
@ -45,7 +46,6 @@
|
|||||||
"run-series": "^1.1.9",
|
"run-series": "^1.1.9",
|
||||||
"simple-get": "^4.0.0",
|
"simple-get": "^4.0.0",
|
||||||
"simple-peer": "^9.11.0",
|
"simple-peer": "^9.11.0",
|
||||||
"simple-websocket": "^9.1.0",
|
|
||||||
"socks": "^2.0.0",
|
"socks": "^2.0.0",
|
||||||
"string2compact": "^2.0.0",
|
"string2compact": "^2.0.0",
|
||||||
"unordered-array-remove": "^1.0.2",
|
"unordered-array-remove": "^1.0.2",
|
||||||
|
Loading…
Reference in New Issue
Block a user