This commit is contained in:
Feross Aboukhadijeh 2019-07-04 21:58:13 -07:00
parent c37aac7277
commit 85e7a606a6

View File

@ -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')