Skip to content
Discussion options

You must be logged in to vote

Hi @Fijxu, Thanks for the feedback.

When using a Unix domain socket with Deno.serve, the following string is passed as request.url.

http+unix://%2Ftmp%2Fsocket%2Esock/your/path

Hono does not support this scheme, so it appears to be processed as a path that differs from the original intent.

We will consider whether to support this scheme in Hono’s default getPath(), but in the current version, you can process URLs using this scheme by specifying getPath() as follows.

const app = new Hono({
  getPath: (req) => new URL(req.url).pathname
})

app.get('/', (c) => {
  return c.text('Hello Hono!')
})

Deno.serve(
  {
    path: '/tmp/socket.sock',
  },
  app.fetch
)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Fijxu
Comment options

Answer selected by Fijxu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants