-
Notifications
You must be signed in to change notification settings - Fork 37
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
example doesn't work #38
Comments
bump |
same here. i searched and saw some discussion about this. any update? |
Seems this project is broken, I'm having the same issue :( |
|
This following example is working for me const router = require('koa-router')();
const websockify = require('koa-websocket');
const Koa = require('koa');
const app = websockify(new Koa());
router.get('/ping', async (ctx) => {
ctx.websocket.send('Hello world');
ctx.websocket.on('message', (message) => {
console.log(message);
ctx.websocket.send(message);
});
});
app.ws.use(router.routes()).use(router.allowedMethods());
app.listen(3000); Then test with $ wscat --connect ws://localhost:3000/ping *[feature/JWA-3699-user-i-want-to-have-an-api-endp]
Connected (press CTRL+C to quit)
< Hello world
> Test
< Test
> My
|
This still works with @koa/router |
Does it work with latest version though? I don’t see how it suddenly works. |
hahah honestly, your guess is as good as mine. Im using it right now without any issues |
When I try to debug with
wscat -c ws://localhost:3000
nothing happens :(The text was updated successfully, but these errors were encountered: