Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Laravel-websockets not working over HTTPS (Laragon Apache - Localhost) #864

@Aniket-IN

Description

@Aniket-IN

Laravel-Websockets not working over HTTPS on Laragon (Apache)

Currently I'm using the default Laragon generated SSL certificate, I'm not sure how to add the SSL certificates with my Websocket.

My project directory: E:\Websites\laravel\ComputerReflex

My SSL Directory: E:\laragon\etc\ssl

On the documention it's mentioned to add the SSL certificate path on .env file, which I've tried but after doing that the websockets even stops working over HTTP

LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=E:\laragon\etc\ssl\laragon.crt
LARAVEL_WEBSOCKETS_SSL_LOCAL_PK=E:\laragon\etc\ssl\laragon.key
// config/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'),
                'encrypted' => true,
                'host' => '127.0.0.1',
                'port' => 6001,
                'scheme' => 'https' // Tried http -> https
            ],
            
        ],
import Echo from 'laravel-echo';

window.Pusher = require('pusher-js');

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: process.env.MIX_PUSHER_APP_KEY,
    wsHost: window.location.hostname, // Returns 'computerreflex.test'
    wsPort: 6001,
    wssPort: 6001,
    disableStats: true,
    forceTLS: true,
    enabledTransports: ['ws', 'wss']
});

Working over HTTP
Working over HTTP

Not working over HTTPS
Not working over HTTPS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions