laravel-websockets
laravel-websockets copied to clipboard
WSS Connection error
Hello,
I have a strange problem with WSS, only WS is working but I really need the WSS
My dependencies :
Composer json : - "beyondcode/laravel-websockets": "^1.13", package-json : - "jquery": "^3.6.0", - "laravel-echo": "^1.11.3", - "pusher-js": "^4.4.0", - "visibilityjs": "^2.0.2"
Broadcasting.php
[
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY', 'fatehdnlwrnncffhjewf'),
'secret' => env('PUSHER_APP_SECRET', 'eerrpmlmqkahxbqnklhrt'),
'app_id' => env('PUSHER_APP_ID', 'hijfeihaswgeojzapoza'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER', 'mt1'),
'port' => 6002,
'useTLS' => false,
'encrypted'=> false,
'host' => 'blabla.com',
'scheme' => 'https',
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
],
]
index.js
window.Echo = new Echo({
broadcaster: 'pusher',
key: 'fatehdnlwrnncffhjewf',
cluster: 'mt1',
wsHost: window.location.hostname,
wssPort: 6002,
wsPort: 6002,
enableStats: true,
encrypted: true,
enabledTransports: ['ws', 'wss']
})
websocket.php
[
'id' => env('PUSHER_APP_ID', 'hijfeihaswgeojzapoza'),
'name' => env('APP_NAME'),
'key' => env('PUSHER_APP_KEY', 'fatehdnlwrnncffhjewf'),
'secret' => env('PUSHER_APP_SECRET', 'eerrpmlmqkahxbqnklhrt'),
'path' => env('PUSHER_APP_PATH'),
'cluster' => 'mt1',
'capacity' => null,
'enable_client_messages' => true,
'enable_statistics' => true,
'encrypted' => false,
]
Also, I set the url with letsencrypt ssl key.
the message error is : WebSocket connection to 'wss://blabla.com:6002/app/fatehdnlwrnncffhjewf?protocol=7&client=js&version=4.4.0&flash=false' failed:
https://github.com/beyondcode/laravel-websockets/issues/920#issuecomment-1010956181
https://github.com/beyondcode/laravel-websockets/issues/962#issue-1164941119
In Broadcasting.php,
'encrypted'=> true,
try again ?
Let me check and I'll come back quickly
In Broadcasting.php,
'encrypted'=> true,
try again ?
I already did that and still not working ...
Really strange, output console.dev
@AmityTek did you fin solution?
I am facing the same problem on the server, in terminal shows that Starting the WebSocket server on port 6001...
and nothing happened. But in local, this is working fine. I didn't add any SSL certificate for WebSocket is it ok or not?
@nayeemdev If you manage to fix the issue, let me please share.
My app is hosted on digital ocean
@nayeemdev If you manage to fix the issue, let me please share.
My app is hosted on digital ocean
@Fajendagba I didn't able to run this into server anyhow, at last I removed laravel-websocket and work with only pusher
@nayeemdev alright man
If you're doing Proxy server, follow this https://www.batra.dev/blog/websocket-laravel-forge-ssl-configuration
@manshu please access is denied to the page
Still relevant today, I have a let's encrypt certificate and I can't make the websocket server work:
Pusher error: cURL error 35: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to xxxxxx.org:6001