Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mediumart/echo.io

A socket.io server implementation for laravel-echo
https://github.com/mediumart/echo.io

ioredis laravel laravel-echo redis socket-io

Last synced: about 1 month ago
JSON representation

A socket.io server implementation for laravel-echo

Awesome Lists containing this project

README

        

# Echo.io (WIP)

## Description
> The package is still a in development! please use with caution.

This is a socket.io server implementation for laravel-echo. It consist of 3 components:
- A node.js server (which is this repository)
- A [javascript client](https://github.com/mediumart/echo.io-client) for the browser (which you should use in place of the **socket.io-client** script)
- A [php library](https://github.com/mediumart/echo.io-php) that handle integration with the laravel framework.

## Installation
```
$ npm install echo.io
```
You will also need to install the others components mentionned above.

Add a secret key, that will be use for authentication, either by defining an environment variable named `AUTH_KEY`(that will be fetched using `process.env.AUTH_KEY`) or just by using the instance function `echo.auth('')` before calling `echo.listen()`.

this can be any random string for now, but the exact same secret key should be configured for the [php library](https://github.com/mediumart/echo.io-php), on the laravel framework side.

## Usage
```js
const Echo = require('echo.io');
const echo = new Echo({
// socket.io options
io: {},

// ioredis options
// can be an object, an array of arguments or a string
// example: 'redis://127.0.0.1:6379' or
// [6380, '192.168.100.1', { password: 'password' }] or
// { path: '/tmp/echo.sock' }
redis: {},
});

// default port to 6001
echo.listen('', '');
```