Skip to content

Commit c8cc97a

Browse files
committed
Fix for unknown port
For example, in torrents from Yify their tracker has url "udp://tracker.yify-torrents.com/announce" in which case a crtitical error is shown because "port should be in range from 0 to 65535"
1 parent 7858111 commit c8cc97a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ Client.prototype._requestUdp = function (announceUrl, opts) {
208208
})
209209

210210
function send (message) {
211+
if(parsedUrl.port==null) {
212+
parsedUrl.port=80;
213+
}
211214
socket.send(message, 0, message.length, parsedUrl.port, parsedUrl.hostname)
212215
}
213216

0 commit comments

Comments
 (0)