#Is it possible to use oak with soket.io-deno?

4 messages · Page 1 of 1 (latest)

dapper plover
#

How to use https://github.com/oakserver/oak together with https://github.com/socketio/socket.io-deno ?
Could not find any examples.

GitHub

A middleware framework for handling HTTP with Deno 🐿️ 🦕 - GitHub - oakserver/oak: A middleware framework for handling HTTP with Deno 🐿️ 🦕

GitHub

Socket.IO server for Deno. Contribute to socketio/socket.io-deno development by creating an account on GitHub.

fast spruce
#

Hardly. socket.ios handler needs a ConnInfo object as argument, which isn't accessible from oak, so socket.io can't be used as a middleware for oak
and using the oak handle method like

... 
await serve(io.handler((req) => app.handle(req), { port: 8000 });
... 

isn't possible because oaks handle method returns a Promise which isn't compatible with the return type of the additional handler expected by socket.io.

dapper plover
fast spruce