当我在服务器中上传(inmotionhosting,Centos7)时,我安装laravel websockets 在 localhost 中运行良好(inmotionhosting,Centos7)不起作用
播客.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' => 'rdms.sawagroup.org',
'port' => 8443,
'scheme' => 'https',
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
],
],
websockets.php
'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,
'encrypted' => true,
main.js
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,
encrypted: true,
wsHost: window.location.hostname,
wsPort: 8443,
wssPort: 8443,
forceTLS: true,
disableStats: false,
enabledTransports: ['ws', 'wss'],
authorizer: channel => ({
authorize: (socketId, callback) => {
axios.post('/api/broadcasting/auth', {
socket_id: socketId,
channel_name: channel.name,
})
.then(response => {
callback(false, response.data)
})
.catch(error => {
callback(true, error)
})
},
}),
})
我阅读了文档,但我不明白如何获取 pem 文件