Skip to content

Commit 84f6107

Browse files
committed
check for domain names in data.peers6
1 parent 0b831d2 commit 84f6107

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,10 @@ Tracker.prototype._handleResponse = function (requestUrl, data) {
512512
})
513513
} else if (Array.isArray(data.peers6)) {
514514
// tracker returned normal response
515-
var ip = /^\[/.test(peer.ip)
516-
? peer.ip
517-
: '[' + peer.ip + ']'
518515
data.peers6.forEach(function (peer) {
516+
var ip = /^\[/.test(peer.ip) || !/:/.test(peer.ip)
517+
? peer.ip /* ipv6 w/ brackets or domain name */
518+
: '[' + peer.ip + ']' /* ipv6 without brackets */
519519
self.client.emit('peer', ip + ':' + peer.port)
520520
})
521521
}

0 commit comments

Comments
 (0)