elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
9.88k stars 211 forks source link

Some callback functions missing for WebSockets #384

Open mikelgmh opened 8 months ago

mikelgmh commented 8 months ago

In the Elysia WebSockets documentation I see that there are 4 callback functions:

But there are some useful ones that are missing that are in the uWebSockets library documentation.

The subscription() callback function is specially important to handle the subscriptions to topics and to track users in websockets. Is there any plan to add these callback functions?

kitanga-nday-bptn commented 8 months ago

If you want to use uWebSocket functionality, Elysia exposes the uWebSocket socket in the raw prop.

This is an assumption btw, based on some tests I've been doing. Can't verify right now but you can.

mikelgmh commented 8 months ago

If you want to use uWebSocket functionality, Elysia exposes the uWebSocket socket in the raw prop.

This is an assumption btw, based on some tests I've been doing. Can't verify right now but you can.

Unfortunately the subscription() callback is missing in the raw property of the socket, but is missing on the Bun.js websockets callbacks documentation too. Thank you anyway!

mikelgmh commented 8 months ago

There are some uWebSockets functionalities missing in bun.js. Check this GitHub issue: https://github.com/oven-sh/bun/issues/2988

Moyo-Made commented 8 months ago

There are some uWebSockets functionalities missing in bun.js. Check this GitHub issue: oven-sh/bun#2988

is this issue still open? If yes i want to work on it

mikelgmh commented 8 months ago

There are some uWebSockets functionalities missing in bun.js. Check this GitHub issue: oven-sh/bun#2988

is this issue still open?

If yes i want to work on it

Yes, the issue is still open in both repositories.