diff --git a/client.js b/client.js index 2b923d7..1681a4a 100644 --- a/client.js +++ b/client.js @@ -513,9 +513,9 @@ Tracker.prototype._handleResponse = function (requestUrl, data) { } else if (Array.isArray(data.peers6)) { // tracker returned normal response data.peers.forEach(function (peer) { - var ip = /:/.test(peer.ip) ? - '[' + peer.ip + ']' : - peer.ip + var ip = /^\[/.test(peer.ip) + ? peer.ip + : '[' + peer.ip + ']' self.client.emit('peer', ip + ':' + peer.port) }) }