From 8e29227003abcc6cfacc401dcf5370c965b2195f Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 29 May 2015 14:24:28 -0700 Subject: [PATCH] emit 'warning' for unsupported tracker protocol --- client.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client.js b/client.js index 18587a9..4315f51 100644 --- a/client.js +++ b/client.js @@ -79,6 +79,11 @@ function Client (peerId, port, torrent, opts) { return new UDPTracker(self, announceUrl, trackerOpts) } else if ((protocol === 'ws:' || protocol === 'wss:') && webrtcSupport) { return new WebSocketTracker(self, announceUrl, trackerOpts) + } else { + process.nextTick(function () { + var err = new Error('unsupported tracker protocol for ' + announceUrl) + self.emit('warning', err) + }) } return null })