I deployed a standalone WebSocket server in google cloud. Following the laravel-websockets configuration, I can connect to my server when I go to <ip address>/laravel-websockets
.
I installed an SSL certificate from Let's Encrypt then I configured the .env
file to point to my certs and key files:
LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=/etc/letsencrypt/live/mydomain.com/fullchain.pem
LARAVEL_WEBSOCKETS_SSL_LOCAL_PK=/etc/letsencrypt/live/mydomain.com/privkey.pem
Then I open the WebSockets dashboard, using the domain name instead of the IP mydomain.com/laravel-websockets
. I restarted apache sudo systemctl restart apache2
and run php artisan WebSockets:serve
. Then I tried connecting but failed.
The console shows:
WebSocket connection to 'wss://mydomain.com:6001/app/mypusherkey?protocol=7&client=js&version=4.3.1&flash=false' failed
Please advise as I need this to work soon. Thank you.