Skip to content

Http1 disconnectAll() doesn't work #77

@stefan-guggisberg

Description

@stefan-guggisberg

When making an Http1 request followed by disconnectAll() the process doesn't exit.

When running the following snippet the process hangs, i.e. node doesn't exit. It seems like disconnectAll() doesn't unref the socket.

const { fetch, disconnectAll } = require('fetch-h2');

(async function () {
  const resp = await fetch('https://httpbin.org/status/200');
  await disconnectAll();
}());

OTOH, when making an Http2 request, the process exits as expected:

const { fetch, disconnectAll } = require('fetch-h2');

(async function () {
  const resp = await fetch('https://www.nghttp2.org/httpbin/status/200');
  await disconnectAll();
}());

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions