simonhamp / echo Goto Github PK
View Code? Open in Web Editor NEWThis project forked from laravel/echo
A version of Laravel Echo with a Ratchet connector
License: MIT License
This project forked from laravel/echo
A version of Laravel Echo with a Ratchet connector
License: MIT License
https://github.com/simonhamp/echo/blob/ratchet-connector/src/connector/ratchet-connector.ts#L28
If you compare with the socket.io implementation, socket.io returns an id
property on the socket which is a unique ID (just some random string, not sure how they build it). Echo depends on it and sends it in the X-Socket-Id
header to the server. The ratchet implementation probably needs some kind of replacement for that somehow.
426 no sec-websocket-protocols requested supported
Hi I need help here please.
this is my vue component:
export default {
mounted() {
Echo.channel('test').listen('NewComment', (comment) => {
console.log(comment);
});
}
}
and this is how I fired my event
event(new NewComment());
and this is my event:
class NewComment implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public function __construct()
{
}
public function broadcastOn()
{
return new Channel('test');
}
public function broadcastWith(){
return [
'body' => 'this is a test comment'
];
}
}
.env file
BROADCAST_DRIVER=zmq
ratchet config
'class' => \Askedio\LaravelRatchet\Examples\Pusher::class,
'host' => '127.0.0.1',
'port' => '8080',
'connectionLimit' => false,
'throttle' => [
'onOpen' => '5:1',
'onMessage' => '20:1',
],
'abortOnMessageThrottle' => false,
'blackList' => [],
'zmq' => [
'host' => '127.0.0.1',
'port' => 5555,
'method' => \ZMQ::SOCKET_PULL,
],
zmq config
'default' => 'publish',
'connections' => [
'publish' => [
'dsn' => 'tcp://127.0.0.1:5555',
'method' => \ZMQ::SOCKET_PUB,
],
'subscribe' => [
'dsn' => 'tcp://127.0.0.1:5555',
'method' => \ZMQ::SOCKET_SUB,
],
]
I see in the console this message:
Message from 461: {"event":"subscribe","message":{"channel":"test","auth":{"headers":{"X-CSRF-TOKEN":"n58mMNrwsALL5NMBkRNlGSJzJvs3DuzUt7Q6MoQO"}}}}
But when firing the event I don't see any thing happen.
the onMessage
of socket server not firing.
Is there something I'v missed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.