How to properly setup sendEndpointMessage and receive endpoint messages

So I want to set up sendEndpointMessage in index.html in the jitsi-meet folder. for starters is this something I am able to do or does this have to be setup in the lib-jitsi-meet files? if I am able to do it in the file I specified, what exactly with the code I wrote below since I am produced the following errors

setInterval(function () {
			const ids = Array.from(['features/base/participants'].remote.keys());
			for (let id of ids) {
				const text = JSON.stringify({
				  commandName: 'test_command',
				  commandPayload: { test_payload: 'Hi there' } // this is just an example payload
				APP.conference.sendEndpointMessage(id, {
					name: 'endpoint-text-message',
		}, 2000);
		APP.conference._room.on(, () => {
			APP.conference._room.rtc.addEventListener('rtc.data_channel_open', () => {
				console.log('opened a datachannel');
		APP.conference._room.on(, (_, message) => { console.log(message); });

Are websockets to the bridge working on your deployment?

how do I check that?

I never checked to see if websockets to the bridge (I assume you mean videobridge) worked on my deployment, So I have no clue what to look for

Open 3 tabs in the same meeting and checkout the console logs

and what should I be looking for?

is it this?

yes. The channels to the bridge are not working.
Check your nginx config, do you have this: jitsi-meet/jitsi-meet.example at b4f98e7386e75bea52fa4b31c0f109d07621a7ee · jitsi/jitsi-meet · GitHub?
What about the jvb config files?

so in my case I am using apache2

videobridge {
    http-servers {
        public {
            port = 9090
    websockets {
        enabled = true
        domain = "mydomain:443"
        tls = true

nvm seeing this now I realized my issue is that my domain for websockets is wrong (using the wrong port)