Strapi-plugin-io (IO): How to use it

Hello I want to use this pluguin for remove StrapIO . I need to do this:

I have a api for diferent restaurants. I need to connect to strapi when login in an Android app. The recieve its own orders from a pwa. So I create rooms and send the orders to the restaurant room.

I do all this with StrapIO. StrapIO is not a official plugin, so I need to change it with strapi-plugin-io.

The problem is i don’t know how use strapi-plugin-io outside the plugin configutaion i don’t know if i can do this in the order controller as i do with strapIO:

if(check_order.means == 'app'){
       const room = `room${}${}`;
       strapi.$io.raw(room, "newOrderApp", check_order);

Second question is how i can create a infinite latency between strapi-plugin-io and the restaurant app, since restaurant close the app. How and Where.

Thanks i advance for your help.

Ok. We resolve this.

In the pluings.js you need to add:

    "io": {
      "enabled": true,
      "config": {
        "IOServerOptions" :{
          "cors": { "origin": "*", "methods": ["GET","POST"], credentials: true},
        "contentTypes": {
          "order": ["create"],
            "name": "connection",
            "handler": ({ strapi }, socket) => {
    `[io] new connection with id ${}`);
              socket.on('clientPing', ()=>{
                setTimeout(()=> {
                  socket.emit('serverPing')}, 60000);
              socket.on('join', function(room) {

The you can use the strapi.$io in the controllers.

In the client you need to join to the correct room, initialice and reply (to the “serverPing”) with “clientPing”. After connection.