Я использую Soketi в качестве альтернативы толкателя в моей локальной среде, но я сталкиваюсь . < /p>
Детали среды < /p>
[*] ОС: Windows 10 < /li>
PHP версия: 8.4.3
[*] Версия Laravel: 10.x
[*] версия Soketi: последняя (npm install -g @soketi/soketi) < Br /> Redis: Запуск и достижимый (Redis-Cli Ping возвращает Pong) < /li>
Драйвер базы данных: Redis < /li>
< /ul>
Проблема разбивка < /h2>
Soketi начинается, но приложения не указаны. После запуска: < /p>
Код: Выделить всё
soketi start
< /code>
Я вижу: < /p>
🎉 Server is up and running!
📡 The Websockets server is available at 127.0.0.1:6001
🔗 The HTTP API server is available at http://127.0.0.1:6001
< /code>
Но если я запускаю: < /p>
soketi list-apps
< /code>
Ничего не отображается. < /p>
Если я запускаю: < /p>
curl http://127.0.0.1:6001
< /code>
Я получаю 200, который великолепен. < /p>
Но если я запускаю: < /p>
curl http://127.0.0.1:6001/apps/my-app-id
< /code>
Я получаю: < /p>
curl : The remote server returned an error: (404) Not Found.
< /code>
Попытка 2: Вручное создание приложения не работает < /h2>
Я попробовал вручную создать приложение: < / / p>
soketi apps:create --id=my-app-id --key=my-app-key --secret=my-app-secret
< /code>
Нет ошибок, но я все еще получаю те же результаты ... < /p>
Попытка 3: Пробое об использовании файл конфигурации < /h2>
Я создал config.json в c: \ users \ xxx.soketi: < /p>
{
"port": 6001,
"host": "127.0.0.1",
"appManager": {
"driver": "array",
"apps": [
{
"id": "my-app-id",
"key": "my-app-key",
"secret": "my-app-secret",
"maxConnections": -1,
"enableClientMessages": true,
"enabled": true,
"maxBackendEventsPerSecond": -1,
"maxClientEventsPerSecond": -1,
"maxReadRequestsPerSecond": -1
}
]
},
"database": {
"redis": {
"host": "127.0.0.1",
"port": 6379,
"db": 0
}
}
}
< /code>
затем ran: < /p>
soketi start --config C:\Users\nico_\.soketi\config.json
Я получаю этот вывод: < /p>
Код: Выделить всё
Connected (press CTRL+C to quit)
Disconnected (code: 1006, reason: "")
< /code>
и Soketi сбои: < /p>
(base) PS C:\Users\nico_\Documents\Projects\Restaurant Manager\restaurant-api> soketi start --config C:\Users\nico_\.soketi\config.json --debug
🕵️♂️ Initiating metrics endpoints...
🎉 Server is up and running!
📡 The Websockets server is available at 127.0.0.1:6001
🔗 The HTTP API server is available at http://127.0.0.1:6001
🎊 The /usage endpoint is available on port 9601.
(node:35948) NOTE: The AWS SDK for JavaScript (v2) is in maintenance mode.
SDK releases are limited to address critical bug fixes and security issues only.
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the blog post at https://a.co/cUPnyil
(Use `node --trace-warnings ...` to show where the warning was created)
process uncaughtException
{
err: TypeError: Cannot read properties of undefined (reading 'enabled')
at AppManager.findByKey (C:\Users\nico_\AppData\Local\nvm\v18.20.6\node_modules\@soketi\soketi\dist\app-managers\app-manager.js:44:51)
at WsHandler.checkForValidApp (C:\Users\nico_\AppData\Local\nvm\v18.20.6\node_modules\@soketi\soketi\dist\ws-handler.js:528:39)
at WsHandler.onOpen (C:\Users\nico_\AppData\Local\nvm\v18.20.6\node_modules\@soketi\soketi\dist\ws-handler.js:54:14)
at open (C:\Users\nico_\AppData\Local\nvm\v18.20.6\node_modules\@soketi\soketi\dist\server.js:446:50)
at WsHandler.handleUpgrade (C:\Users\nico_\AppData\Local\nvm\v18.20.6\node_modules\@soketi\soketi\dist\ws-handler.js:199:13)
at upgrade (C:\Users\nico_\AppData\Local\nvm\v18.20.6\node_modules\@soketi\soketi\dist\server.js:448:68),
origin: 'uncaughtException'
}
🚫 New users cannot connect to this instance anymore. Preparing for signaling...
⚡ The server is closing and signaling the existing connections to terminate.
< /code>
Что я проверил < /h2>
Soketi работает и прослушивает порт 6001 (NetStat -Ano | findstr: 6001 ). Попрох отключил брандмауэр). < /li>
Нет синтаксических ошибок в config.json (проверка с помощью json lint). < /li>
< /ul>
Справочные источники: < /h2>
.env:
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=my-app-id
PUSHER_APP_KEY=my-app-key
PUSHER_APP_SECRET=my-app-secret
PUSHER_HOST=127.0.0.1
PUSHER_PORT=6001
PUSHER_SCHEME=http
PUSHER_APP_CLUSTER=mt1
< /code>
Дополнительные примечания: < /h2>
Я получаю это, когда запускаю Soketi, < /p>
Initiating metrics endpoints...
🎉 Server is up and running!
📡 The Websockets server is available at 127.0.0.1:6001
🔗 The HTTP API server is available at http://127.0.0.1:6001
🎊 The /usage endpoint is available on port 9601.
(node:11496) NOTE: The AWS SDK for JavaScript (v2) is in maintenance mode.
SDK releases are limited to address critical bug fixes and security issues only.
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the blog post at https://a.co/cUPnyil
(Use `node --trace-warnings ...` to show where the warning was created)
Подробнее здесь: https://stackoverflow.com/questions/794 ... i-requests
Мобильная версия