I'm using laravel-websockets and is working like a charm in my local docker machine but I can't seem to make it work when I deploy it in the AWS EC2 machine.
This is the error message I get:
pusher.min.js:8 WebSocket connection to
'wss://sample.project:6001/app/b0901feacd04936e?protocol=7&client=js&version=4.3.1&flash=false' failed:
These are my config files:
broadcasting.php
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => '127.0.0.1',
'port' => 6001,
'scheme' => 'http',
],
],
websockets.php
'apps' => [
[
'id' => env('PUSHER_APP_ID'),
'name' => env('APP_NAME'),
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'enable_client_messages' => false,
'enable_statistics' => true,
],
],
bootstrap.js
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
cluster: process.env.MIX_PUSHER_APP_CLUSTER,
wsHost: window.location.hostname,
wsPort: 6001,
forceTLS: false,
disableStats: true,
});
I've opened 6001 port in my security group:
But I can't make it work. I've tried a lot of the fixes in other SO questions but none worked, am I missing something? In desperate need of help here.
Thank you very much.