11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst http = require('http'); 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ciconst testServer = http.createServer(common.mustNotCall()); 61cb0ef41Sopenharmony_citestServer.on('connect', common.mustCall((req, socket, head) => { 71cb0ef41Sopenharmony_ci socket.write('HTTP/1.1 200 Connection Established\r\n' + 81cb0ef41Sopenharmony_ci 'Proxy-agent: Node-Proxy\r\n' + 91cb0ef41Sopenharmony_ci '\r\n'); 101cb0ef41Sopenharmony_ci // This shouldn't raise an assertion in StreamBase::Consume. 111cb0ef41Sopenharmony_ci testServer.emit('connection', socket); 121cb0ef41Sopenharmony_ci testServer.close(); 131cb0ef41Sopenharmony_ci})); 141cb0ef41Sopenharmony_citestServer.listen(0, common.mustCall(() => { 151cb0ef41Sopenharmony_ci http.request({ 161cb0ef41Sopenharmony_ci port: testServer.address().port, 171cb0ef41Sopenharmony_ci method: 'CONNECT' 181cb0ef41Sopenharmony_ci }, (res) => {}).end(); 191cb0ef41Sopenharmony_ci})); 20