I'd be happy to propose a PR, but I'd recommend rewriting the transport with fetch instead of extending the current approach:
|
const req = base.request(url, opts, (res: Socket) => { |
... As I'd have to use setTimeout(), which would make the code more complicated.
The drawback of fetch() is that it'd require Node.js 18+. Which shouldn't be too bad as Node.js 16 is reaching EOL in a few weeks.