Skip to content

Commit 132d9f7

Browse files
committed
Update http agent mock to node 5+
1 parent 9362638 commit 132d9f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/client.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var Client = require('../')
33
var common = require('./common')
44
var fixtures = require('webtorrent-fixtures')
55
var http = require('http')
6+
var net = require('net')
67
var test = require('tape')
78

89
var peerId1 = Buffer.from('01234567890123456789')
@@ -388,9 +389,9 @@ function testClientStartHttpAgent (t, serverType) {
388389
common.createServer(t, serverType, function (server, announceUrl) {
389390
var agent = new http.Agent()
390391
var agentUsed = false
391-
agent.createSocket = function (req, options) {
392+
agent.createConnection = function (opts, fn) {
392393
agentUsed = true
393-
return http.Agent.prototype.createSocket.call(this, req, options)
394+
return net.createConnection(opts, fn)
394395
}
395396
var client = new Client({
396397
infoHash: fixtures.leaves.parsedTorrent.infoHash,

0 commit comments

Comments
 (0)