Hono supports Socket.io? #1781
Unanswered
PatricioPoncini
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Hi @PatricioPoncini , So I came across to this problem as well last week. But, if you take a look at hono import { Server } from 'socket.io'
import { Server as HttpServer } from 'http'
import { Hono } from 'hono'
const app = new Hono()
const server = serve(app)
const io = new Server(server as HttpServer) Note that the type cast depends on the option you pass to Hope this helps :) |
Beta Was this translation helpful? Give feedback.
4 replies
-
Bun is not written this way. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone, I would like to know if Hono supports Socket.io, as I want to set up a socket service with Socket.io but I'm having issues with the ServerType. Since Socket.io only accepts one of these types:
http.Server | HTTPSServer | Http2SecureServer | number
And when I start a server with Hono, it returns the type
ServerType
so the Socket.io library gives me problems because it does not accept that typing. Does anyone know how I can set up the server with Hono and pass it as an argument to Socket.io?Beta Was this translation helpful? Give feedback.
All reactions