We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 24d9422 + 5c90b2b commit b0efe65Copy full SHA for b0efe65
client.js
@@ -85,7 +85,14 @@ class Client extends EventEmitter {
85
86
this._trackers = announce
87
.map(announceUrl => {
88
- const protocol = url.parse(announceUrl).protocol
+ const parsedUrl = url.parse(announceUrl)
89
+ const port = parsedUrl.port
90
+ if (port < 0 || port > 65535) {
91
+ nextTickWarn(new Error(`Invalid tracker port: ${announceUrl}`))
92
+ return null
93
+ }
94
+
95
+ const protocol = parsedUrl.protocol
96
if ((protocol === 'http:' || protocol === 'https:') &&
97
typeof HTTPTracker === 'function') {
98
return new HTTPTracker(this, announceUrl)
0 commit comments