Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket routes not working in plugins #205

Closed
veneficium42 opened this issue Sep 21, 2023 · 2 comments
Closed

WebSocket routes not working in plugins #205

veneficium42 opened this issue Sep 21, 2023 · 2 comments

Comments

@veneficium42
Copy link

When a websocket route is defined in a plugin, it won't work correctly.
Ex.

import Elysia from "elysia"

const ws = new Elysia().ws("/", {
    message(ws, message) {
        console.log(message)
    }
})

const app = new Elysia()
    .use(ws)
    .listen(4500)

test script

const ws = new WebSocket("ws://0.0.0.0:4500/");

ws.addEventListener("error", (e)=>console.log(e))
ws.addEventListener("open", ()=>ws.send("ping"))

The console won't output anything but neither will the test script
Expected console output: ping

@SaltyAom
Copy link
Member

SaltyAom commented Sep 22, 2023

Should be fixed in 62cd02a

Let me know if the problem still persists

@veneficium42
Copy link
Author

It seems to be fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants