GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node/test/sequential/test-https-server-keep-alive-timeout.js at main · ide/node Expand file tree/ Copy pathtest-https-server-keep-alive-timeout.jsMore file actions 79 lines (70 loc) · 2.12 KB / Copy pathtest-https-server-keep-alive-timeout.jsFile metadata and controls79 lines (70 loc) · 2.12 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 'use strict'; const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); const fixtures = require('../common/fixtures'); const https = require('https'); const tls = require('tls'); const tests = []; const serverOptions = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem') }; function test(fn) { if (!tests.length) { process.nextTick(run); } tests.push(fn); } function run() { const fn = tests.shift(); if (fn) fn(run); } test(function serverKeepAliveTimeoutWithPipeline(cb) { const server = https.createServer( serverOptions, common.mustCall((req, res) => { res.end(); }, 3)); server.setTimeout(common.platformTimeout(500), common.mustCall((socket) => { // End this test and call `run()` for the next test (if any). socket.destroy(); server.close(); cb(); })); server.keepAliveTimeout = common.platformTimeout(50); server.listen(0, common.mustCall(() => { const options = { port: server.address().port, allowHalfOpen: true, rejectUnauthorized: false }; const c = tls.connect(options, () => { c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); c.write('GET /2 HTTP/1.1\r\nHost: localhost\r\n\r\n'); c.write('GET /3 HTTP/1.1\r\nHost: localhost\r\n\r\n'); }); })); }); test(function serverNoEndKeepAliveTimeoutWithPipeline(cb) { const server = https.createServer(serverOptions, common.mustCall(3)); server.setTimeout(common.platformTimeout(500), common.mustCall((socket) => { // End this test and call `run()` for the next test (if any). socket.destroy(); server.close(); cb(); })); server.keepAliveTimeout = common.platformTimeout(50); server.listen(0, common.mustCall(() => { const options = { port: server.address().port, allowHalfOpen: true, rejectUnauthorized: false }; const c = tls.connect(options, () => { c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); c.write('GET /2 HTTP/1.1\r\nHost: localhost\r\n\r\n'); c.write('GET /3 HTTP/1.1\r\nHost: localhost\r\n\r\n'); }); })); }); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |