diff --git a/lib/client/udp-tracker.js b/lib/client/udp-tracker.js index 56e1b8a..99ee5b9 100644 --- a/lib/client/udp-tracker.js +++ b/lib/client/udp-tracker.js @@ -5,7 +5,7 @@ const compact2string = require('compact2string') const debug = require('debug')('bittorrent-tracker:udp-tracker') const dgram = require('dgram') const randombytes = require('randombytes') -const url = require('url') +const URL = require('url').URL const common = require('../common') const Tracker = require('./tracker') @@ -73,7 +73,7 @@ class UDPTracker extends Tracker { _request (opts) { const self = this if (!opts) opts = {} - const parsedUrl = url.parse(this.announceUrl) + const parsedUrl = new URL(this.announceUrl) let transactionId = genTransactionId() let socket = dgram.createSocket('udp4')