Comments (11)
@kashtanoff Every '.' in an event name gets replaced with a '' by the echo client lib.
so actually the even that's being listened to (prefixed with the dot) is 'ticket\created'.
By default the namespace is added 'App\Events\ticket\created'.
from laravel-echo-server.
onDisconnect(socket: any, channel: string): void {
socket.on('disconnect', () => this.leave(socket, channel));
if (this.options.devMode) {
Log.info(`[${new Date().toLocaleTimeString()}] - ${socket.id} left channel: ${channel}`);
}
}
Left channel
notice is for onDisconnect
function, not for disconnect
function. This line of notice may mislead understand server actions. I think we should put it in actual disconnect
function.
from laravel-echo-server.
i sent
{
"channel": "tickets",
"message": {
"event":"ticket.created",
"data": {
"key": "value"
}
}
}
to localhost:6001/broadcast
and get next answer
{
"message": "ok"
}
but not have any frames in websocket
from laravel-echo-server.
If you are using http to broadcast you will need to setup referrers.
from laravel-echo-server.
I change config and setup referers before use http broadcast
"referrers": [
{
"host": "*",
"apiKey": "zjhm1Mhedce5Jjci31t1i9Hi2behml1hiXep5m+Ld524aeqd5LPc8e8s=pnl"
}
],
But I not receive any information on client side. Client side code:
window.Echo.channel('tickets')
.listen('ticket.created', function(e){
console.log(e.order.name);
});
from laravel-echo-server.
Until a new version of laravel echo is released to npm you will need to add a .
at the beginning of your event name: .ticket.created
There have been some PRs submitted to allow no namespace but this has not been officially released yet. The above will help for now.
laravel/echo#64
from laravel-echo-server.
I try add .
at the beginning of my event name. It did not help me.
from laravel-echo-server.
Thank you. This solve my problem.
from laravel-echo-server.
I run into the same issue, I don't why left channel after joined channel.
[1:31:38 PM] - xwuyyLDSOlciVRD8AAAA joined channel: chat-room
[1:31:38 PM] - xwuyyLDSOlciVRD8AAAA left channel: chat-room
@kashtanoff How did you solve this problem?
from laravel-echo-server.
Good call! See #97 for PR
from laravel-echo-server.
Thanks, @barryvdh !
from laravel-echo-server.
Related Issues (20)
- Is the package compromised? HOT 6
- Laravel-echo-server events listeners custom callbacks
- Redis6 ACL Support HOT 1
- 运行一会,就会中断,提示截图显示的错误 HOT 2
- Cannot find module '../dist/cli' - supervisord
- Redis 6 ACL config HOT 1
- Connection refused on docker
- Laravel Echo Server work and client side error only at server HOT 2
- Is there ways to emit data from client (socket.io-client) to laravel-echo-server? HOT 2
- Laravel Echo PresenceChannel vs listen events doesn't work HOT 2
- 使用Laravel 5.8 广播系统,本地研发没有事情,上线后握手阶段,第一次OK,第二次报502,第三次报session id unknown,现在不知道是那个地方出问题了?求帮助 HOT 1
- Is `tlaverdure/laravel-echo-server` abandoned? HOT 6
- Is the cors configuration even working? HOT 1
- echo server socket.io.js error
- support redis cluster
- Redis TTL key is store forever
- CSRF token mismatch after session timeout
- npx laravel-echo-server start HOT 1
- Unable to join channel. Member data for presence channel missing HOT 1
- Is this project compatible with Socket.io v4? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-echo-server.