mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 20:21:36 +00:00
client _handleResponse: allow string form of peer.ip
This commit is contained in:
parent
7376843920
commit
4f1ea32f35
@ -497,8 +497,10 @@ Tracker.prototype._handleResponse = function (requestUrl, data) {
|
||||
// tracker returned normal response
|
||||
data.peers.forEach(function (peer) {
|
||||
var ip = peer.ip
|
||||
var addr = ip[0] + '.' + ip[1] + '.' + ip[2] + '.' + ip[3] + ':' + peer.port
|
||||
self.client.emit('peer', addr)
|
||||
var host = ip.length == 4 ?
|
||||
(ip[0] + '.' + ip[1] + '.' + ip[2] + '.' + ip[3]) :
|
||||
ip.toString()
|
||||
self.client.emit('peer', host + ':' + peer.port)
|
||||
})
|
||||
}
|
||||
} else if (requestUrl === self._scrapeUrl) {
|
||||
|
Loading…
Reference in New Issue
Block a user