Skip to content

Commit 76d80e6

Browse files
docs: add guide for listening to UNIX domain socket (#292)
1 parent 0a4826c commit 76d80e6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,23 @@ app.get('/', (c) => {
326326
serve(app)
327327
```
328328

329+
## Listen to a UNIX domain socket
330+
331+
You can configure the HTTP server to listen to a UNIX domain socket instead of a TCP port.
332+
333+
```ts
334+
import { createAdaptorServer } from '@hono/node-server'
335+
336+
// ...
337+
338+
const socketPath ='/tmp/example.sock'
339+
340+
const server = createAdaptorServer(app)
341+
server.listen(socketPath, () => {
342+
console.log(`Listening on ${socketPath}`)
343+
})
344+
```
345+
329346
## Related projects
330347

331348
- Hono - <https://hono.dev>

0 commit comments

Comments
 (0)