Hi! I’d like to use users id as channel, to communicate an mobile app to our front end app, I dont need to persist the data, so I’d like to always send a json file with the user coords, but using a exclusive channel per user. I already create some channels, but for everyone, so I’d like a step by step way to receive that data in my front end, thank you!
this is my config:
io: {
enabled: true,
config: {
IOServerOptions: {
cors: { origin: "http://localhost:3000", methods: ["GET"] },
},
contentTypes: {
message: "*",
chat: ["create"],
vehicles: "*",
},
events: [
{
name: "connection",
handler: ({ strapi }, socket) => {
// console.log(socket);
// strapi.log.info(`[io] new connection with id ${socket.id}`);
socket.on("setLocation", (data) => {
// console.log(data);
setTimeout(() => {
socket.emit("getLocation", data);
}, 1000);
});
socket.on("join", function (room) {
socket.join(room);
});
},
},
],
},
},
as I said before, I already communicate both, but using common channels, not exclusive channels. What recommend you?