Having issues getting secure websockets to work in laravel on AWS elastic beanstalk.
They work fine in dev and production over http & ws.
In dev it works fine over https and wss.
In production (with all the same settings, just different certs) over https and wss i'm getting the following error
failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED
Assuming a problem with the certificate or key, I've tried changing to an incorrect cert & key.
Then the error changes to the following.
failed: Error in connection establishment:
net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH
So i'm assuming that the certificate isn't the issue.
Config as below:
websockets.php
'apps' => [
[
'id' => env('PUSHER_APP_ID'),
'name' => env('APP_NAME'),
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'path' => env('PUSHER_APP_PATH'),
'capacity' => null,
'enable_client_messages' => true,
'enable_statistics' => true,
],
],
'ssl' => [
/*
* Path to local certificate file on filesystem. It must be a PEM encoded file which
* contains your certificate and private key. It can optionally contain the
* certificate chain of issuers. The private key also may be contained
* in a separate file specified by local_pk.
*/
'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null),
/*
* Path to local private key file on filesystem in case of separate files for
* certificate (local_cert) and private key.
*/
'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null),
/*
* Passphrase for your local_cert file.
*/
'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),
'verify_peer' => false,
],
.env file
LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=/etc/pki/tls/certs/cert.cer
LARAVEL_WEBSOCKETS_SSL_LOCAL_PK=/etc/pki/tls/certs/server.key
Please add a Passphrase to your Cert-File and to env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null).
I had same issues with Keystores without Password.
Related
I am using dockerized environment for laravel project.
Everything is glued by nginx proxy.
There is additional docker container to run laravel-websockets server.
It works when I try to connect to it using postman. It connects, I cand send message to subscribe, it even receives broadcasted events. The issue is both firefox and vivaldi (chromium based) cant connect to it.
Firefox can’t establish a connection to the server at wss://****:6001/app/pusher-key?protocol=7&client=js&version=4.3.1&flash=false.
Apart from laravel websockets I tried soketi but same thing.
Nginx proxy I used https://github.com/nginx-proxy/nginx-proxy
Websockets are handled by https://github.com/beyondcode/laravel-websockets
Certificates are self signed but they do work in Postman, no idea why browser has issues D :
Here is addition to nginx proxy template
location /app {
proxy_pass https://127.0.0.1:6001;
proxy_set_header Host $host;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
# Allow the use of websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
Packages used
Composer
"beyondcode/laravel-websockets": "^1.13",
"pusher/pusher-php-server": "~7.0.2",
npm
"pusher-js": "^5.1.1",
broadcasting.php
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY','app-key'),
'secret' => env('PUSHER_APP_SECRET','app-secret'),
'app_id' => env('PUSHER_APP_ID','app-id'),
'options' => [
'host' => env('PUSHER_HOST', '127.0.0.1'),
'port' => env('PUSHER_PORT', 6001),
'scheme' => 'http',
'encrypted' => false,
'useTLS' => false,
'cluster' => 'mt1',
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
],
],
websockets.php
<?php
return [
/*
* This package comes with multi tenancy out of the box. Here you can
* configure the different apps that can use the webSockets server.
*
* Optionally you can disable client events so clients cannot send
* messages to each other via the webSockets.
*/
'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,
],
],
/*
* This class is responsible for finding the apps. The default provider
* will use the apps defined in this config file.
*
* You can create a custom provider by implementing the
* `AppProvider` interface.
*/
'app_provider' => BeyondCode\LaravelWebSockets\Apps\ConfigAppProvider::class,
/*
* This array contains the hosts of which you want to allow incoming requests.
* Leave this empty if you want to accept requests from all hosts.
*/
'allowed_origins' => [
//
],
/*
* The maximum request size in kilobytes that is allowed for an incoming WebSocket request.
*/
'max_request_size_in_kb' => 250,
/*
* This path will be used to register the necessary routes for the package.
*/
'path' => 'laravel-websockets',
'statistics' => [
/*
* This model will be used to store the statistics of the WebSocketsServer.
* The only requirement is that the model should extend
* `WebSocketsStatisticsEntry` provided by this package.
*/
'model' => \BeyondCode\LaravelWebSockets\Statistics\Models\WebSocketsStatisticsEntry::class,
/*
* Here you can specify the interval in seconds at which statistics should be logged.
*/
'interval_in_seconds' => 60,
/*
* When the clean-command is executed, all recorded statistics older than
* the number of days specified here will be deleted.
*/
'delete_statistics_older_than_days' => 60,
/*
* Use an DNS resolver to make the requests to the statistics logger
* default is to resolve everything to 127.0.0.1.
*/
'perform_dns_lookup' => false,
],
/*
* Define the optional SSL context for your WebSocket connections.
* You can see all available options at: http://php.net/manual/en/context.ssl.php
*/
'ssl' => [
/*
* Path to local certificate file on filesystem. It must be a PEM encoded file which
* contains your certificate and private key. It can optionally contain the
* certificate chain of issuers. The private key also may be contained
* in a separate file specified by local_pk.
*/
'local_cert' => storage_path('certificates/default.crt'),
/*
* Path to local private key file on filesystem in case of separate files for
* certificate (local_cert) and private key.
*/
'local_pk' => storage_path('certificates/default.key'),
/*
* Passphrase for your local_cert file.
*/
'passphrase' => null
],
];
EDIT:
The below code is all working, it turned out the SSLs I have been using prior to changing them were good after all, but that something else was wrong when they were good. I will delete this post.
I have searched through many many pages online with various solutions and unfortunately none have worked. I am getting errors from the browser:
Firefox can’t establish a connection to the server at wss://MYDOMAIN:6001/app/MYAPPID?protocol=7&client=js&version=7.0.6&flash=false.
And in Chrome:
WebSocket connection to 'wss://MYDOMAIN:6001/app/MYAPPID?protocol=7&client=js&version=7.0.6&flash=false' failed:
I managed to get it working perfectly, even in production but only when I do not load https (I temporarily turned off my forcing of redirect to https to test).
However with https I have ran out of ideas.
Obviously with everything below in place, and cache in all places cleared I run:
php artisan websockets:serve
The result in the terminal is that it stays on Starting the WebSocket server on port 6001... with no other activity.
Its worth noting that when I do try to broadcast an event in Laravel I get no errors, whereas if I change settings (e.g. put in a wrong path for the SSL, or take something out of the broadcasting.php config, I do get an error that I cannot connect to pusher. So I am assuming based on this my config with pusher is ok.
config/broadcasting.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'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' => 'https',
'useTLS' => true,
'encrypted' => true,
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];
/config/websockets.php
<?php
use BeyondCode\LaravelWebSockets\Dashboard\Http\Middleware\Authorize;
return [
/*
* Set a custom dashboard configuration
*/
'dashboard' => [
'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
],
/*
* This package comes with multi tenancy out of the box. Here you can
* configure the different apps that can use the webSockets server.
*
* Optionally you specify capacity so you can limit the maximum
* concurrent connections for a specific app.
*
* Optionally you can disable client events so clients cannot send
* messages to each other via the webSockets.
*/
'apps' => [
[
'id' => env('PUSHER_APP_ID'),
'name' => env('APP_NAME'),
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'enable_client_messages' => true,
'enable_statistics' => true,
],
],
/*
* This class is responsible for finding the apps. The default provider
* will use the apps defined in this config file.
*
* You can create a custom provider by implementing the
* `AppProvider` interface.
*/
'app_provider' => BeyondCode\LaravelWebSockets\Apps\ConfigAppProvider::class,
/*
* This array contains the hosts of which you want to allow incoming requests.
* Leave this empty if you want to accept requests from all hosts.
*/
'allowed_origins' => [
//
],
/*
* The maximum request size in kilobytes that is allowed for an incoming WebSocket request.
*/
'max_request_size_in_kb' => 250,
/*
* This path will be used to register the necessary routes for the package.
*/
'path' => 'laravel-websockets',
/*
* Dashboard Routes Middleware
*
* These middleware will be assigned to every dashboard route, giving you
* the chance to add your own middleware to this list or change any of
* the existing middleware. Or, you can simply stick with this list.
*/
'middleware' => [
'web',
Authorize::class,
],
'statistics' => [
/*
* This model will be used to store the statistics of the WebSocketsServer.
* The only requirement is that the model should extend
* `WebSocketsStatisticsEntry` provided by this package.
*/
'model' => \BeyondCode\LaravelWebSockets\Statistics\Models\WebSocketsStatisticsEntry::class,
/*
* Here you can specify the interval in seconds at which statistics should be logged.
*/
'interval_in_seconds' => 60,
/*
* When the clean-command is executed, all recorded statistics older than
* the number of days specified here will be deleted.
*/
'delete_statistics_older_than_days' => 60,
/*
* Use an DNS resolver to make the requests to the statistics logger
* default is to resolve everything to 127.0.0.1.
*/
'perform_dns_lookup' => false,
],
/*
* Define the optional SSL context for your WebSocket connections.
* You can see all available options at: http://php.net/manual/en/context.ssl.php
*/
'ssl' => [
/*
* Path to local certificate file on filesystem. It must be a PEM encoded file which
* contains your certificate and private key. It can optionally contain the
* certificate chain of issuers. The private key also may be contained
* in a separate file specified by local_pk.
*/
'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null),
/*
* Path to local private key file on filesystem in case of separate files for
* certificate (local_cert) and private key.
*/
'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null),
/*
* Passphrase for your local_cert file.
*/
'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),
'verify_peer' => false
],
/*
* Channel Manager
* This class handles how channel persistence is handled.
* By default, persistence is stored in an array by the running webserver.
* The only requirement is that the class should implement
* `ChannelManager` interface provided by this package.
*/
'channel_manager' => \BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager::class,
];
my ts file:
window.pusher = new Pusher('MYAPPID', {
cluster: 'mt1',
forceTLS: true,
enabledTransports: ['ws', 'wss'],
wssPort: 6001,
wsPort: 6001,
wsHost: 'MYDOMAIN'
});
window.Echo = new Echo({
broadcaster: 'pusher',
key: 'MYAPPKEY',
cluster: 'mt1',
wsHost: 'MYDOMAIN',
wssPort: 6001,
wsPort: 6001,
forceTLS: true,
enabledTransports: ['ws', 'wss'],
encrypted: true,
disableStats: true
});
.env: Note, for the SSLs, I tried my own domain SSLs, they did not work so I then followed these instructions to generate them.
PUSHER_APP_ID=MYAPPID
PUSHER_APP_KEY=MYAPPKEY
PUSHER_APP_SECRET=MYAPPSECRET
PUSHER_APP_CLUSTER=mt1
LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT="/path/to/mycert.crt"
LARAVEL_WEBSOCKETS_SSL_LOCAL_PK="/path/to/mycert.key"
BROADCAST_DRIVER=pusher
Overview
This is my first time working with websockets.
The project I'm working in is using the Laravel framework, so I chose to give Laravel Websockets (version 1.3.0) a try.
I set up a simple proof-of-concept project using this package, and in so-doing was able to get it up and running successfully. Communication in this proof-of-concept is insecure though (ws://).
Now, I'm trying to integrate the Laravel Websockets package into a production application which is secured with SSL, and in this instance, when I try to establish a connection from the /laravel-websockets dashboard, I am instantly presented with an error in my browser's console ERR_CONNECTION_RESET.
The network tab shows communication is being attempted securely (wss://).
It shows the proper domain name and port as well.
Because of this, I think the problem is server-side, yet I still don't know where the problem is.
I have encountered the same results in my local dev environment (Win 10/IIS/PHP7.4/Self-signed SSL Cert), as well as in a sandbox environment (Win Server 2016/IIS/PHP7.4/Let's Encrypt SSL Cert)
In case it makes any difference, in my local dev environment, I'm using the HOSTS file to redirect traffic from myapp.dev.local to 127.0.0.1
Relevant Parts Of My .env
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=XXX
PUSHER_APP_KEY=XXX
PUSHER_APP_SECRET=IHAVENEVERDONETHISBEFORE
PUSHER_APP_CLUSTER=mt1
LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT="C:/certificate.cer"
#LARAVEL_WEBSOCKETS_SSL_LOCAL_PK="C:/privateKey.key"
#LARAVEL_WEBSOCKETS_SSL_PASSPHRASE=1234
When reviewing the documentation for the laravel-websockets library, I see that I need to configure the config/websockets.php file to point to my certificate file(s) and that they must be PEM encoded. After doing a quick search online, it looks like .cer, .crt, .pem files will all fit this bill. I have used an MMC snap-in to Export the Certificate in use as Base-64 encoded X.509 (CER), and have been pointing my environment variables to it.
Any suggestions how I can get this to work?
websockets.php
/*
* Define the optional SSL context for your WebSocket connections.
* You can see all available options at: http://php.net/manual/en/context.ssl.php
*/
'ssl' => [
/*
* Path to local certificate file on filesystem. It must be a PEM encoded file which
* contains your certificate and private key. It can optionally contain the
* certificate chain of issuers. The private key also may be contained
* in a separate file specified by local_pk.
*/
'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null),
/*
* Path to local private key file on filesystem in case of separate files for
* certificate (local_cert) and private key.
*/
'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null),
/*
* Passphrase for your local_cert file.
*/
'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),
'allow_self_signed' => true,
'verify_peer' => false,
],
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' => 'https',
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
],
],
bootstrap.js
import Echo from 'laravel-echo'
console.log('Here')
window.Pusher = require('pusher-js');
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
cluster: process.env.MIX_PUSHER_APP_CLUSTER,
forceTLS: true,
wsHost: window.location.hostname,
wsPort: 6001,
wssPort: 6001,
disableStats: true,
enabledTransports: ['ws', 'wss'], // <-- only use ws and wss as valid transports
});
I'm running a server with plesk, and trying to find the .key and .crt files that are generated by letsencrypt.
I'm running plesk on an Ubuntu server and have already tried the .pem files but my web-sockets wont accept those.
Does anybody know the location/file-path of these files?
paths for keys
/usr/local/psa/var/modules/letsencrypt/etc/live/mydomain.com/fullchain.pem
/usr/local/psa/var/modules/letsencrypt/etc/live/mydomain.com/privkey.pem
websockets
/*
* Path to local certificate file on filesystem. It must be a PEM encoded file which
* contains your certificate and private key. It can optionally contain the
* certificate chain of issuers. The private key also may be contained
* in a separate file specified by local_pk.
*/
'local_cert' => env('LOCAL_CERT'),
//'local_cert' => null,
/*
* Path to local private key file on filesystem in case of separate files for
* certificate (local_cert) and private key.
*/
'local_pk' => env('LOCAL_PK'),
//'local_cert' => null,
/*
* Passphrase for your local_cert file.
*/
'passphrase' => env('PASSPHRASE', null),
'verify_peer' => false,
],
Broadcasting
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => 'eu',
'host' => env('PUSHER_APP_HOST'),
'port' => env('PUSHER_APP_PORT'),
'scheme' => 'https',
//'useTLS' => true,
//'encrypted' => true,
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
],
],
LetsEncrypt will use .pem on ubuntu. The file extension shouldn't matter though, so if you are encountering an error when trying to use the pem files files then you should share and investigate the error message.
Everything is done according to your guide, re-read several times, looked at a bunch of answers on Google, but my error is not fixed! Here is a mistake:
enter image description here
enclose code:
use BeyondCode\LaravelWebSockets\Dashboard\Http\Middleware\Authorize;
return [
/*
* Set a custom dashboard configuration
*/
'dashboard' => [
'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
],
/*
* This package comes with multi tenancy out of the box. Here you can
* configure the different apps that can use the webSockets server.
*
* Optionally you specify capacity so you can limit the maximum
* concurrent connections for a specific app.
*
* Optionally you can disable client events so clients cannot send
* messages to each other via the webSockets.
*/
'apps' => [
[
'id' => env('PUSHER_APP_ID'),
'name' => env('APP_NAME'),
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'path' => env('PUSHER_APP_PATH'),
'capacity' => null,
'enable_client_messages' => true,
'enable_statistics' => true,
],
],
/*
* This class is responsible for finding the apps. The default provider
* will use the apps defined in this config file.
*
* You can create a custom provider by implementing the
* `AppProvider` interface.
*/
'app_provider' => BeyondCode\LaravelWebSockets\Apps\ConfigAppProvider::class,
/*
* This array contains the hosts of which you want to allow incoming requests.
* Leave this empty if you want to accept requests from all hosts.
*/
'allowed_origins' => [
//
],
/*
* The maximum request size in kilobytes that is allowed for an incoming WebSocket request.
*/
'max_request_size_in_kb' => 250,
/*
* This path will be used to register the necessary routes for the package.
*/
'path' => 'laravel-websockets',
/*
* Dashboard Routes Middleware
*
* These middleware will be assigned to every dashboard route, giving you
* the chance to add your own middleware to this list or change any of
* the existing middleware. Or, you can simply stick with this list.
*/
'middleware' => [
'web',
Authorize::class,
],
'statistics' => [
/*
* This model will be used to store the statistics of the WebSocketsServer.
* The only requirement is that the model should extend
* `WebSocketsStatisticsEntry` provided by this package.
*/
'model' => \BeyondCode\LaravelWebSockets\Statistics\Models\WebSocketsStatisticsEntry::class,
/*
* Here you can specify the interval in seconds at which statistics should be logged.
*/
'interval_in_seconds' => 60,
/*
* When the clean-command is executed, all recorded statistics older than
* the number of days specified here will be deleted.
*/
'delete_statistics_older_than_days' => 60,
/*
* Use an DNS resolver to make the requests to the statistics logger
* default is to resolve everything to 127.0.0.1.
*/
'perform_dns_lookup' => false,
],
/*
* Define the optional SSL context for your WebSocket connections.
* You can see all available options at: http://php.net/manual/en/context.ssl.php
*/
'ssl' => [
/*
* Path to local certificate file on filesystem. It must be a PEM encoded file which
* contains your certificate and private key. It can optionally contain the
* certificate chain of issuers. The private key also may be contained
* in a separate file specified by local_pk.
*/
'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null),
/*
* Path to local private key file on filesystem in case of separate files for
* certificate (local_cert) and private key.
*/
'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null),
/*
* Passphrase for your local_cert file.
*/
'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),
],
/*
* Channel Manager
* This class handles how channel persistence is handled.
* By default, persistence is stored in an array by the running webserver.
* The only requirement is that the class should implement
* `ChannelManager` interface provided by this package.
*/
'channel_manager' => \BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager::class,
];
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'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'),
'useTLS' => true,
],
'host' => '127.0.0.1',
'post' => 6001,
'scheme' => 'https'
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];
import Echo from 'laravel-echo'
window.Pusher = require('pusher-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,
});
PUSHER_APP_ID=1323123
PUSHER_APP_KEY=312313123
PUSHER_APP_SECRET=312313
PUSHER_APP_CLUSTER=mt1
BROADCAST_DRIVER=pusher
APP_URL=http://smart-php.design
My site has https, maybe you need to configure it somehow? Therefore, an error occurs, before a “message” was sent to me, but after my manipulations everything again broke down.
Here is the url: http://smart-php.design
I will be extremely grateful for the support!
Thanks in advance!
You need to setup ssl certificate (refer to their document on ssl) otherwise just turn off the encryption and serve over WS.