Server IP : 162.213.251.212 / Your IP : 18.225.72.200 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/allssztx/www/easybuyer/node_modules/stream-http/test/browser/ |
Upload File : |
var Buffer = require('buffer').Buffer var fs = require('fs') var test = require('tape') var http = require('../..') test('timeout', function (t) { var req = http.get({ path: '/browserify.png?copies=5', requestTimeout: 10 // ms }, function (res) { res.on('data', function (data) { }) res.on('end', function () { t.fail('request completed (should have timed out)') }) }) req.on('requestTimeout', function () { t.pass('got timeout') t.end() }) }) // TODO: reenable this if there's a way to make it simultaneously // fast and reliable test.skip('no timeout after success', function (t) { var req = http.get({ path: '/basic.txt', requestTimeout: 50000 // ms }, function (res) { res.on('data', function (data) { }) res.on('end', function () { t.pass('success') global.setTimeout(function () { t.end() }, 50000) }) }) req.on('requestTimeout', function () { t.fail('unexpected timeout') }) })