http: support generic `Duplex` streams
Support generic Duplex
streams through more duck typing
on the server and client sides.
Since HTTP is, as a protocol, independent of its underlying transport layer, Node.js should not enforce any restrictions on what streams its HTTP parser may use.
Ref: https://github.com/nodejs/node/issues/16256
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
http