mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-02-20 20:29:02 +00:00
fix client handling to support http peers
non-compact response
This commit is contained in:
parent
4f1ea32f35
commit
deee4e1d7d
@ -496,11 +496,7 @@ Tracker.prototype._handleResponse = function (requestUrl, data) {
|
||||
} else if (Array.isArray(data.peers)) {
|
||||
// tracker returned normal response
|
||||
data.peers.forEach(function (peer) {
|
||||
var ip = peer.ip
|
||||
var host = ip.length == 4 ?
|
||||
(ip[0] + '.' + ip[1] + '.' + ip[2] + '.' + ip[3]) :
|
||||
ip.toString()
|
||||
self.client.emit('peer', host + ':' + peer.port)
|
||||
self.client.emit('peer', peer.ip + ':' + peer.port)
|
||||
})
|
||||
}
|
||||
} else if (requestUrl === self._scrapeUrl) {
|
||||
|
Loading…
Reference in New Issue
Block a user