question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

example doesn't work

See original GitHub issue
const koa = require('koa');
const websockify = require('koa-websocket');
const router = require('koa-router');
const app = new koa();
const api = router();
const socket = websockify(app);

api.get('/*', function* (next) {
    this.websocket.send('Hello World');
    this.websocket.on('message', function(message) {
        console.log(message);
    });
});

app.ws.use(api.routes()).use(api.allowedMethods());
app.listen(3000);

When I try to debug with wscat -c ws://localhost:3000 nothing happens 😦

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kudoscommented, Apr 24, 2019

koa-router is not explicitly supported, but patches with tests are welcome.

2reactions
ofaucorpcommented, Jul 13, 2018

same here. i searched and saw some discussion about this. any update?

Read more comments on GitHub >

github_iconTop Results From Across the Web

I don't know why this three.js example doesn't work
I'm currently using VS-Code & have two files : index.html and index.js By copying a simple example from threejs.org I can't seem to...
Read more >
Nextjs example SSR doesnt work. · Issue #1735 - GitHub
In the nextjs-supabase-auth example the SSR functionality doesn't work. I can't get it to work either. In the API where the cookie is...
Read more >
What to do if the code doesn't work? - GeeksforGeeks
This article will discuss the different routes one could take if their code fails to work in various scenarios.
Read more >
Troubleshooting and tips — Numba 0.50.1 documentation
When Numba tries to compile your code it first tries to work out the types of all the ... respectively, and doesn't know...
Read more >
Beginning example doesn't work - Get Help - Vue Forum
Why doesn't the beginner example on the site that is in JSFiddle work?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found