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

Server not run #22

Closed
duchuy2707 opened this issue Feb 29, 2024 · 2 comments
Closed

Server not run #22

duchuy2707 opened this issue Feb 29, 2024 · 2 comments

Comments

@duchuy2707
Copy link

hi Apteryx

import * as ws from 'ws';

export function SOCKET(
  client: ws.WebSocket,
) {
  console.clear();
  console.log('\n--------\n', 'A client connected!', '\n--------\n');

  client.on('message', message => {
    client.send(message);
  });

  client.on('close', () => {
    console.log('A client disconnected!');
  });
}

I've tried to test as in the example to create a socket server like the code snippet below, but it seems it's not working. No console logs are appearing, and it seems like the code isn't being called. I'm using "next": "13.4.19" with app routes.

If you have time, could you assist me, please?
Thank you very much, and I wish you good health.

@apteryxxyz
Copy link
Owner

apteryxxyz commented Mar 2, 2024

next-ws does not support [email protected], you need <=13.4.12 or >=13.5.1.

@duchuy2707
Copy link
Author

hi @apteryxxyz
thank you for support <3

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