oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.4k stars 2.78k forks source link

Named pipes don't work for HTTP servers #15350

Open mjomble opened 3 days ago

mjomble commented 3 days ago

What version of Bun is running?

1.1.36+ededc168c

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

Script 1:

import { createServer } from 'node:net'
const server = createServer()
server.listen('\\\\.\\pipe\\test')

Script 2:

import { createServer } from 'node:http'
const server = createServer((req, res) => res.end('ok'))
server.listen('\\\\.\\pipe\\test')

Script 3:

Bun.serve({
    unix: '\\\\.\\pipe\\test',
    async fetch() {
        return new Response('ok')
    },
})

What is the expected behavior?

All three scripts execute successfully and start listening on the socket without throwing any errors.

What do you see instead?

Script 1 succeeds.

Scripts 2 and 3 both fail with

ENOENT: No such file or directory
   errno: -2
 syscall: "listen"
   path: "\\.\pipe\test"

Additional information

No response

cirospaciari commented 3 days ago

AF_UNIX is currently support by Bun.serve but not named pipes yet. Named Pipes is missing support on node:http and currently supported on node:tls, node:net and node:http2