Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unix domain socket support #89

Open
MrFoxPro opened this issue Oct 31, 2023 · 1 comment
Open

Unix domain socket support #89

MrFoxPro opened this issue Oct 31, 2023 · 1 comment

Comments

@MrFoxPro
Copy link

No description provided.

@TransparentLC
Copy link

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);

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants