能不能有前輩可以幫我看看!
今天為了測試html5 web 開啟相機掃描 QR 功能,因為需要 https 連線,所以索性將本地開發機 ,掛上 固定 ip 並使用 sslfree 的免費證書,安裝好之後卻發生如下報錯 :
WebSocket connection to 'wss://我的域名?protocol=7&client=js&version=7.0.2&flash=false' failed: Error during WebSocket handshake: Unexpected response code: 404
這應該怎麼處裡??
我的pusher 設定如下:
1、config/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' => false,
'enable_statistics' => true,
],
],
...省略
2、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' => 'http' //這裡曾嘗試修改成https => 結果無效
],
],
...省略
3、bootstrap.js
... 省略
import Echo from 'laravel-echo';
window.Pusher = require('pusher-js');
window.Echo = new Echo({
broadcaster: 'pusher',
key: '我的密碼',
wsHost: window.location.hostname,
wsPort: 6001,
forceTLS: false,
disableStats: true,
});
...省略
期待前輩指導,謝謝!