From ccb75faed9ae1a311008676f9be7d7aca4337964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=E5=B0=8F=E9=80=8F=E6=98=8E=E3=83=BB=E5=AE=B8?= =?UTF-8?q?=E2=9C=A8?= <47057319+TransparentLC@users.noreply.github.com> Date: Thu, 11 Dec 2025 23:12:20 +0800 Subject: [PATCH] docs: add guide for listening to UNIX domain socket --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index fd046c3..e0c5f79 100644 --- a/README.md +++ b/README.md @@ -326,6 +326,23 @@ app.get('/', (c) => { serve(app) ``` +## Listen to a UNIX domain socket + +You can configure the HTTP server to listen to a UNIX domain socket instead of a TCP port. + +```ts +import { createAdaptorServer } from '@hono/node-server' + +// ... + +const socketPath ='/tmp/example.sock' + +const server = createAdaptorServer(app) +server.listen(socketPath, () => { + console.log(`Listening on ${socketPath}`) +}) +``` + ## Related projects - Hono -