laravel-echo

Laravel Echo Listener not working on frontend

独自空忆成欢 提交于 2021-02-11 06:51:08
问题 I have created an event: <?php namespace App\Events; use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Broadcasting\PresenceChannel; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; class QueueStatus implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; public $queue; public

Laravel Echo not listening for pusher events

爷,独闯天下 提交于 2021-02-10 20:23:48
问题 Trying to create a kind of chat app with laravel and vuejs. Once the message is sent, I fire the event from laravel which reflects on the pusher debug console with the right event class but the listen callback from vuejs is not called at all. created () { window.Echo.channel('chat') .listen('MessageSent', (e) => { console.log(e); //not getting this this.sentMessages.push({ message: e.message.message, user: e.user }); }); }, Below is a screenshot of the debug console from pusher see the image

Laravel Echo not listening for pusher events

梦想与她 提交于 2021-02-10 20:21:52
问题 Trying to create a kind of chat app with laravel and vuejs. Once the message is sent, I fire the event from laravel which reflects on the pusher debug console with the right event class but the listen callback from vuejs is not called at all. created () { window.Echo.channel('chat') .listen('MessageSent', (e) => { console.log(e); //not getting this this.sentMessages.push({ message: e.message.message, user: e.user }); }); }, Below is a screenshot of the debug console from pusher see the image

Laravel Echo - Allow guests to connect to presence channel

蹲街弑〆低调 提交于 2021-02-06 10:57:20
问题 I am using laravel-echo-server to run Laravel Echo to broadcast events. I have a user counter channel which shows all the users on the app. For this I am using a presence channel. This works fine for logged in users, but guests just never get connected. I've setup the below in the BroadcastServiceProvider: Broadcast::channel('global', function () { return ['name' => 'guest']; }); Which from what I can tell, should allow everyone in as 'guests'. I'm guessing there's some middleware or auth

Laravel (Echo, Sanctum, websockets) + Pusher + Nuxtjs SPA

你说的曾经没有我的故事 提交于 2021-01-29 07:33:37
问题 I'm trying to send events to private channel, but I can't receive them. Otherwise it works fine for public channels. Here's my code : Plugin : Echo.js window.Echo = new Echo({ broadcaster: 'pusher', key: process.env.MIX_PUSHER_PUBLIC_KEY, wsHost: process.env.VUE_APP_WEBSOCKETS_SERVER , //window.location.hostname,// cluster: process.env.MIX_PUSHER_APP_CLUSTER, wsPort: 6001, forceTLS: false, /* key: process.env.MIX_ABLY_PUBLIC_KEY, wsHost: 'realtime-pusher.ably.io', wsPort: 443, */ disableStats

Unable to authenticate laravel private channel using Laravel echo server, redis and socket.io

て烟熏妆下的殇ゞ 提交于 2021-01-28 08:52:12
问题 I am using Laravel Echo server, redis and socket.io for Chat Messages. I am broadcasting event using. event(new MessageSent($messageThread)); This is private channel with method brodcastOn as follows: public function broadcastOn() { return new PrivateChannel('message.' . $this->broadcastUser->id); } My routes/channels.php looks like: Broadcast::channel('message.*', function ($user, $id) { return (int) $user->id === (int) $id; }); Below is my laravel-echo-server.json : { "authHost": "http:/

Laravel Echo Client cannot be authenticated

你离开我真会死。 提交于 2021-01-28 06:34:52
问题 I see this question has been asked multiple times, but non of the answers are working so I am asking for help and some insight with it. I am using laravel echo and redis for broadcasting events. My laravel echo server stars up nicely, redis is running nicely. When I reload my webpage I get this error in the laravel-echo server terminal: ⚠ [4:49:19 PM] - qg4WSWl5YusQY8hJAAAA could not be authenticated to private-test-channel.1 {"error":"Unauthenticated."} Client can not be authenticated, got

Why isn't Nginx changing the protocol to WebSocket?

萝らか妹 提交于 2020-12-15 21:10:33
问题 I am trying to run Laracvel-echo. Host configuration: location /socket.io { proxy_pass http://127.0.0.1:6002/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } I catch headers with Socat: socat -v TCP-LISTEN:6002,fork TCP:127.0.0.1:6001 On my DEV server, I see that everything is ok, the protocol is changing (HTTP/1.1 101 Switching Protocols) : 2020/10/22 13:51:36.147102 length=175 from=0 to=174 HTTP/1.1 101

Why isn't Nginx changing the protocol to WebSocket?

末鹿安然 提交于 2020-12-15 21:00:12
问题 I am trying to run Laracvel-echo. Host configuration: location /socket.io { proxy_pass http://127.0.0.1:6002/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } I catch headers with Socat: socat -v TCP-LISTEN:6002,fork TCP:127.0.0.1:6001 On my DEV server, I see that everything is ok, the protocol is changing (HTTP/1.1 101 Switching Protocols) : 2020/10/22 13:51:36.147102 length=175 from=0 to=174 HTTP/1.1 101

WebSocket with Laravel-echo-server: 502 Bad gateway

我的未来我决定 提交于 2020-12-13 03:39:18
问题 I can't find a solution for more than a week. Everything works fine on the dev server, but not on production. I have no strength, I appeal to you, colleagues :) I'm using Laravel-echo-server on Socket.io using CloudFlare. When trying to connect, I get an error: WebSocketError: Unexpected status code received (502 Bad Gateway) Ubuntu 16.04.7 LTS, Laravel Echo Server : 1.6.1, NodeJs : v12.19.0 laravel-echo-server.json: { "authHost": "http://localhost", "authEndpoint": "/broadcasting/auth",