soketi / echo-server Goto Github PK
View Code? Open in Web Editor NEWEcho Server is a Docker-ready, multi-scalable Node.js application used to host your own Socket.IO server for Laravel Broadcasting.
License: MIT License
Echo Server is a Docker-ready, multi-scalable Node.js application used to host your own Socket.IO server for Laravel Broadcasting.
License: MIT License
I followed the example and this is what I'm getting on server.
This is setup is working if I change the driver to pusher and switch the client back to Echo, so I'm not sure what's causing the issue.
{
time: '2021-05-13T14:02:32.041Z',
socketId: '527949193.2462276927',
action: 'find_app',
status: 'failed',
error: { reason: 'App undefined not found.' }
}
Works here:
window.Soketi.channel('private-meetings.' + {{ $meeting->id }})
.listen('UserAdmittedToMeeting', e => {
console.log('recieved the push');
console.log(e);
});
Doesn't work here
window.Soketi.channel('private-meetings.'+meetingId)
.listen('UserJoinedMeetingWaitingRoom', e => {
console.log('received the push');
console.log(e);
})
.env
SOCKETIO_HOST=127.0.0.1
SOCKETIO_PORT=6001
SOCKETIO_APP_ID=v3-app
SOCKETIO_APP_KEY=echo-app-key
SOCKETIO_APP_SECRET=echo-app-secret
ECHO_SERVER_APP_DEFAULT_ID=v3-app
ECHO_SERVER_DEFAULT_KEY=echo-app-key
ECHO_SERVER_DEFAULT_SECRET=echo-app-secret
ECHO_SERVER_DEBUG=1
MIX_SOCKETIO_APP_KEY="${SOCKETIO_APP_KEY}"
bootstrap.js
import Soketi from '@soketi/soketi-js';
window.io = require('socket.io-client');
window.Soketi = new Soketi({
host: window.location.hostname,
key: process.env.MIX_SOCKETIO_APP_KEY, // should be replaced with the App Key
authHost: 'http://127.0.0.1',
authEndpoint: '/broadcasting/auth',
broadcasting.php
'socketio' => [
'driver' => 'pusher',
'key' => env('SOCKETIO_APP_KEY'),
'secret' => env('SOCKETIO_APP_SECRET'),
'app_id' => env('SOCKETIO_APP_ID'),
'options' => [
'cluster' => env('SOCKETIO_APP_CLUSTER'),
'encrypted' => true,
'host' => env('SOCKETIO_HOST', '127.0.0.1'),
'port' => env('SOCKETIO_PORT', 6001),
'scheme' => 'http',
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
],
],
],
This is my .env
APPS_MANAGER_DRIVER=mysql
MYSQL_PASSWORD=""
MYSQL_DATABASE=soketi
This is the output of the start command:
database: {
redis: { host: '127.0.0.1', port: 6379, password: null, keyPrefix: '' },
mysql: {
host: '127.0.0.1',
port: 3306,
user: 'root',
password: 'password',
database: 'soketi'
},
postgres: {
host: '127.0.0.1',
port: 5432,
user: 'root',
password: 'password',
database: 'main'
},
local: {},
prometheus: { host: '127.0.0.1', port: 9090, protocol: 'http' }
},
The mysql password is set to the default value of "password" even when explicitly defined as empty string in .env
This project seems to be exactly what I need, but I don't want to be stuck with only being able to use laravel backends. It is pusher compatible, but I have not found a way to change the API host that Pusher-server uses by default. You can only configure the cluster.
When trying to access statistics for an app using the api app driver the echo server sends null
as appKey. I have my echo server running on http://127.0.0.1:6001
so when I visit http://127.0.0.1:6001/apps/echo-app/stats
and log the incoming request on my app server, it shows the query params as shown: { appKey: 'null', token: 'echo-app-token' }
. Furthermore, when I hardcode a response on the app server, the stats show
{
"error": "Unauthorized"
}
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.