Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/mediumart/echo.io
- Owner: mediumart
- Created: 2017-09-23T11:11:42.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-30T05:53:58.000Z (about 7 years ago)
- Last Synced: 2024-10-12T17:03:35.469Z (about 1 month ago)
- Topics: ioredis, laravel, laravel-echo, redis, socket-io
- Language: JavaScript
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
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('', '');
```