bun icon indicating copy to clipboard operation
bun copied to clipboard

Support Socket access from `node:http`

Open Electroid opened this issue 9 months ago • 2 comments

Currently, Bun implements the node:http module using the fetch() API under-the-hood.

https://github.com/oven-sh/bun/blob/b2b7ad235e0261ecf4213e11979f6d1054ff2547/src/js/node/http.ts#L1513-L1523

While this works for basic usage, there are more advanced APIs that we do not support, such as request.socket. Bun uses a no-op for some of these APIs, for now.

Instead, we should rewrite parts of the node:http implementation in native code so we can have better support.

Electroid avatar May 21 '24 16:05 Electroid