Skip to content

Does Hono support WebSocket in deno? #755

Answered by yusukebe
yusukebe asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can write like this:

app.get('/ws/', (c) => {
  const { response, socket } = Deno.upgradeWebSocket(c.req)
  socket.addEventListener('message', (e) => console.log(e))
  return response
})

This is a good article:

Replies: 1 comment 2 replies

Comment options

yusukebe
Dec 29, 2022
Maintainer Author

You must be logged in to vote
2 replies
@erf
Comment options

@erf
Comment options

Answer selected by yusukebe
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