http2-client icon indicating copy to clipboard operation
http2-client copied to clipboard

Cant make more than 1 request in parallel

Open HoshenKadosh opened this issue 1 year ago • 0 comments

when i try to make more than 1 request - only one gets an ok status, and the others return an error without any detail.

code:

const { get } = require("http2-client");

for (let index = 0; index < 2; index++) {
  const req2 = get("https://nghttp2.org/httpbin/get", (e) =>
    console.log("OK", e.statusCode, e.httpVersion)
  );
  req2.on("error", (z) => console.error("ERROR", z));
}

output:

ERROR {
  createConnection: [Function: createConnection],
  protocol: 'https:',
  hostname: 'nghttp2.org',
  hash: '',
  search: '',
  pathname: '/httpbin/get',
  path: '/httpbin/get',
  href: 'https://nghttp2.org/httpbin/get',
  port: 443,
  method: 'GET',
  headers: { ':method': 'GET', ':path': '/httpbin/get' }
}
OK 200 2.0

node version: 18

HoshenKadosh avatar Oct 15 '24 10:10 HoshenKadosh