@@ -1046,9 +1046,6 @@ a connection established via [`curl()`][].
10461046``` mjs
10471047import http from ' node:http' ;
10481048import repl from ' node:repl' ;
1049- import { Buffer } from ' node:buffer' ;
1050-
1051- const buf0 = Buffer .from ([0 ]);
10521049
10531050const server = http .createServer ((req , res ) => {
10541051 res .setHeader (' content-type' , ' multipart/octet-stream' );
@@ -1061,24 +1058,14 @@ const server = http.createServer((req, res) => {
10611058 useColors: true ,
10621059 useGlobal: false ,
10631060 });
1064-
1065- // Hack to thread stdin and stdout
1066- // simultaneously in curl's single thread
1067- const iv = setInterval (() => {
1068- res .write (buf0);
1069- }, 100 );
1070-
1071- req .on (' close' , () => {
1072- clearInterval (iv);
1073- });
10741061});
1062+
10751063server .listen (8000 );
10761064```
10771065
10781066``` cjs
10791067const http = require (' node:http' );
10801068const repl = require (' node:repl' );
1081- const buf0 = Buffer .alloc (1 );
10821069
10831070const server = http .createServer ((req , res ) => {
10841071 res .setHeader (' content-type' , ' multipart/octet-stream' );
@@ -1091,17 +1078,8 @@ const server = http.createServer((req, res) => {
10911078 useColors: true ,
10921079 useGlobal: false ,
10931080 });
1094-
1095- // Hack to thread stdin and stdout
1096- // simultaneously in curl's single thread
1097- const iv = setInterval (() => {
1098- res .write (buf0);
1099- }, 100 );
1100-
1101- req .on (' close' , () => {
1102- clearInterval (iv);
1103- });
11041081});
1082+
11051083server .listen (8000 );
11061084```
11071085
0 commit comments