How to listen websocket connection on server?


I am connecting to meteor server via websocket.

Like that const websocket = new WebSocket("ws://localhost:3000/websocket");

I wanted to run some function when this connection closed. How can I do that?

Can I listen this connection on server? Meteor.onConnection does not work.

Thank you.

1 Like

Interesting too! =)
As I know meteor methods work between it’s self (app and server) via websocket
But if server is ready written, just need front side only

Bump. This would help to know how to hook into Meteor’s existing websocket connection.