Open ghost opened 9 months ago
This bug also extends to node:http
, however, there isn't an error on listen()
with node:http
, just node:net
.
Even though node:http
does not throw an error, it also does not create/listen on the unix domain socket.
This also breaks fastify when attempting to listen on a unix domain socket, because they use the optionsObject
signature and pass { path: ... }
to server.listen()
.
import { createServer } from 'node:http';
const server = createServer((req, res) => {
console.log('connected');
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('connected');
res.end();
});
server.on('listening', () => console.log('listening'));
// server.listen({ host: '127.0.0.1', port: 8123 }); // works
// server.listen('/run/test.sock'); // works ( curl -i http://127.0.0.1/ --unix-socket /run/test.sock )
server.listen({ path: '/run/test.sock' }); // no error, but also does not create/listen this file, listens on http://[::]:3000 instead
import { createServer } from 'node:net';
const server = createServer();
server.on('listening', () => console.log('listening'));
// server.listen({ host: '127.0.0.1', port: 8123 }); // works
// server.listen('/run/test.sock'); // works ( curl -i http://127.0.0.1/ --unix-socket /run/test.sock )
server.listen({ path: '/run/test.sock' }); // error
What version of Bun is running?
1.0.25
What platform is your computer?
Darwin 22.6.0 x86_64 i386
What steps can reproduce the bug?
Place the following code in
index.js
.Run it with
bun index.js
and it will crash with the following error:What is the expected behavior?
node index.js
works fine so I would expectbun index.js
to work fine too since I don't think I'm using any functionality fromnode:net
that's not implement yet.What do you see instead?
No response
Additional information
No response