I am going to setup a websocket I have used soketi package
But I am facing a problem in connecting to the web socket which now i will get this error
code: 4001 message: "App key ---- does not exist." event: "pusher:error"
In general, I have done this to set up the web socket: soketi server :
sub domain : socket.example.com
installing apt install -y git python3 gcc build-essential npm install -g @soketi/soketi
soketi config json
{
"debug": true,
"port": 443,
"appManager.array.apps": [
{
"id": "---",
"key": "---",
"secret": "----"
}
]
}
broadcast :
'host' => env('PUSHER_HOST', '127.0.0.1'),
'port' => env('PUSHER_PORT', 6001),
'scheme' => env('PUSHER_SCHEME', 'http'),
'encrypted' => true,
useTLS' => env('PUSHER_SCHEME') === 'https'
env config:
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=---
PUSHER_APP_KEY=---
PUSHER_APP_SECRET=---
PUSHER_APP_CLUSTER=ap2
PUSHER_SCHEME=https
PUSHER_PORT=443
PUSHER_HOST=127.0.0.1
SOKETI_SSL_CERT=/etc/nginx/ssl/socket.example.com/----/server.crt
SOKETI_SSL_KEY=/etc/nginx/ssl/socket.wourki.com/----/server.key
run soketi soketi start --config=soketi.json
Connect to WebSockets in the main project: domain : example.com
broadcast
'host' => env('PUSHER_HOST', '127.0.0.1'),
'port' => env('PUSHER_PORT', 6001),
'scheme' => env('PUSHER_SCHEME', 'http'),
'encrypted' => true,
useTLS' => env('PUSHER_SCHEME') === 'https'
env config
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=---
PUSHER_APP_KEY=---
PUSHER_APP_SECRET=---
PUSHER_APP_CLUSTER=ap2
PUSHER_SCHEME=https
PUSHER_PORT=443
PUSHER_HOST='socket.example.com'
laravel echo
window.Echo = new Echo({
broadcaster: 'pusher',
key: '----',
cluster: 'ap2',
forceTLS: true,
wsHost:'socket.example.com',
wsPort:6001,
wssPort:443,
encrypted: true,
disableStats: true,
enabledTransports: ['ws', 'wss']
});
So far, I have not had the experience of setting up a web socket. I would be grateful if you could guide me Or introduce me to a tutorial for this