Sockets

The sockets are in the path: src/frontEnd/socketsarrow-up-right which send the data corresponding to the front end.

In this case you should modify the url address from which it should connect, which by default is set for all the urls that connect to this back end (*):

const io = new Server(httpServer, {
    cors: { origin: '*' },
    allowEIO3: true,
});

For example, it could be modified as follows:

origin: 'https://www.myfrontend.com'

The fields that are sent are the following:

socket.emit('Webhook', { type: 'message', message: {
    body,
    status,
    wa_id,
    wam_id,
    type,
    created_at,
    caption,
    data,
    outgoing,
    changeStatus,
    bot,
} });

This data is sent thanks to the event senders that are made in the eventManager file and emitted by the Webhook channel, through which you must receive it in the front end.

Última actualización