Giter Site home page Giter Site logo

soketi / echo-server Goto Github PK

View Code? Open in Web Editor NEW
33.0 3.0 5.0 308 KB

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

JavaScript 0.77% Dockerfile 0.36% TypeScript 98.87%
laravel realtime broadcasting socket io app server node docker scalable

echo-server's Issues

Issue getting a client working

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,
                ],
            ],
        ],

Empty values in .env are ignored instead of parsed

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

Is it possible to use it with a backend that is not Laravel?

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.

Echo server sends appKey as "null" to apps api

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"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.