Replies: 1 comment 1 reply
-
Hi! This is now possible thanks to elysiajs/elysia#1358 (requires import { Server as Engine } from "@socket.io/bun-engine";
import { Server } from "socket.io";
import { Elysia } from "elysia";
const io = new Server();
const engine = new Engine();
io.bind(engine);
io.on("connection", (socket) => {
// ...
});
const app = new Elysia()
.all("/socket.io/", ({ request, server }) => engine.handleRequest(request, server))
.listen({
port: 3000,
...engine.handler(),
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Besides Hono, is it possible to implement Socket.io also in the ElysiaJS framework ? That would be great ! I thought of destructuring the Bun server object, like in Hono, but I don't know if it can be done like this in Elysia. I couldn't find it in the docs and Elysia use chaining, instead of instance export. So i don't know, how to approach it there.
Beta Was this translation helpful? Give feedback.
All reactions