Zain_Zulifqar's avatar

Soketi Websockets Configuration

I am trying to replace pusher with Soketi currently i am stuck on Apps still unable to figure out how to define apps via sql or array driver.

https://docs.soketi.app/app-management/introduction

Thanks

0 likes
6 replies
Sinnbeck's avatar

Just set it up myself. Both on docker (dev) and ploi (Ubuntu server). I used the array config. How are you going to run it?

For my production server I set it up using a json file and ran it with

soketi start --config=/path/to/file.json
Zain_Zulifqar's avatar

@Sinnbeck i am thinking about going with MySql but for now array driver is fine.

Can you also post the structure of your .json file..

Zain_Zulifqar's avatar

@Sinnbeck still not getting it in this code we are getting app from app-manager so how we gonna define apps and which file to load as config app-manager.json or app.json which pulls app from app-manager?

Sinnbeck's avatar

@Zain_Zulifqar sorry I sure what you mean. To run soketi you only need 2 steps

  1. Create a file with the posted content
  2. Run it with soketi start --config=/path/to/file.json

The first part of that file is the array. Need more than 1, you just add more (notice the 0)

I haven't tested the mysql driver, but it seems easy to use

Btw. I set up nginx with a certificate to allow wss, following the example in the docs. But before that I just used ws and port 6001 to make sure it worked

Zain_Zulifqar's avatar
Zain_Zulifqar
OP
Best Answer
Level 5

After lot of searching this is the correct way to achieve multiple apps in soketi with ARRAY as driver.

file.json should be

{
    "appManager.array.apps": [
      {
        "id": "app-id",
        "key": "app-key",
        "secret": "app-secret",
        "maxConnections": -1,
        "enableClientMessages": false,
        "enabled": true,
        "maxBackendEventsPerSecond": -1,
        "maxClientEventsPerSecond": -1,
        "maxReadRequestsPerSecond": -1,
        "webhooks": []
      },
      {
        "id": "app-id-two",
        "key": "app-key-two",
        "secret": "app-secret-two",
        "maxConnections": -1,
        "enableClientMessages": false,
        "enabled": true,
        "maxBackendEventsPerSecond": -1,
        "maxClientEventsPerSecond": -1,
        "maxReadRequestsPerSecond": -1,
        "webhooks": []
      }
    ]
  }

Please or to participate in this conversation.