node-server icon indicating copy to clipboard operation
node-server copied to clipboard

Unix domain socket support

Open 0x241F31 opened this issue 2 years ago • 1 comments

0x241F31 avatar Oct 31 '23 16:10 0x241F31

It seems that you can fill the socket's path directly in the port:

const app = new Hono;
const uds = '/var/run/foobar.sock';

if (fs.existsSync(uds)) {
    fs.unlinkSync(uds);
}
serve({
    fetch: app.fetch,
    hostname: 'localhost',
    port: uds as any,
});
fs.chmodSync(uds, 666);

TransparentLC avatar Jun 01 '24 03:06 TransparentLC