[solved] Connect to Meteor app's web socket server manually

If writing a separate Node.js app, using the ws package is simple. Basically:

const WebSocket = require('./meteor-app/node_modules/ws')

const ws = new WebSocket('ws://')

ws.on('open', () => {
    console.log('connection open.')

ws.on('message', msg => console.log(msg))

// etc

And similarly from in a browser:

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

ws.addEventListener('open', () => {
  console.log('connection open.')

ws.addEventListener('message', msg => console.log(msg))

// etc...

where is where the Meteor app is hosted. By default, it will be localhost:3000 when deving locally.

I couldn’t find the answer on how to do it in these forums, so thought I’d post it.