Answer the question
In order to leave comments, you need to log in
How to run laravel-echo && socket.io?
I can’t connect to laravel-echo, I don’t see the connection in the console, so I can’t send a message, respectively. What are the options?
The message is sent via redis,
L A R A V E L E C H O S E R V E R
version 1.6.2
⚠ Starting server in DEV mode...
✔ Running at localhost on port 6001
✔ Channels are ready.
✔ Listening for http events...
✔ Listening for redis events...
Server ready!
Channel: database_translation
Event: TranslationEvent
const echo = new Echo({
host: 'http://mysite.ru:6001/',
broadcaster: 'socket.io',
client: socketio,
});
let i = echo.join(`database_translation`)
.listen('TranslationEvent', (e) => {
console.log('message from server',e)
this.setState({
result: "changed"
})
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question