I've a project setup that run beyondcode/laravel-websocket. It's configuration is setup so that it can run on local server and it does. Now i have uploaded project on cPanel. I can access the websocket dashboard from the server but i am not being able to connect. Can anyone help me providing step by step guide on setting up websocket on cPanel, like what changes I should do to: (My project is under public_html/projects/myproject)
broadcasting.php
'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' => false,
'encrypted' => false,
'host' => 'my_domain.com', //should be like this or 'my_domain.com/projects' or should i leave it as 127.0.0.1
'port' => 6001,
'scheme' => 'http'
],
],
resources/view/js/bootstrap.js
window._ = require('lodash');
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
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,
forceTLS: false,
wsHost: window.location.hostname,
wsPort: 6001,
encrypted: false,
enabledTransports: ['ws', 'wss']
});
And any other changes needed to any other file, any configuration. Just help me make it run.