GithubHelp home page GithubHelp logo

mpociot / laravel-echo-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tlaverdure/laravel-echo-server

2.0 3.0 0.0 106 KB

Socket.io server for Laravel Echo

License: MIT License

JavaScript 0.84% TypeScript 99.16%

laravel-echo-server's Introduction

Laravel Echo Server

NodeJs server for Laravel Echo broadcasting with Socket.io.

System Requirements

The following are required to function properly.

  • Laravel 5.3
  • Node 6.0+
  • Redis 3+

Additional information on broadcasting with Laravel can be found on the official docs: https://laravel.com/docs/master/broadcasting

Getting Started

Install npm package

npm install laravel-echo-server --save

Create a server.js file and include the following.

var echo = require('laravel-echo-server');

echo.run();

Start server from the command line

$ node server.js

With Configurable Options

Edit the default configuration of the server.

var echo = require('laravel-echo-server');

var options = {
  authHost: 'http://app.dev',
  authPath: '/broadcasting/auth',
  host: 'http://app.dev',
  port: 6001,
  sslCertPath: '/path/to/app.dev.cert',
  sslKeyPath: '/path/to/app.dev.key'
};

echo.run(options);
Title Default Description
authHost http://localhost The host of the server that authenticates private and presence channels
authPath /broadcasting/auth The route that authenticates private channels
host http://localhost The host of the socket.io server
port 6001 The port that the socket.io server should run on
sslCertPath string The path to your server's ssl certificate
sslKeyPath string The path to your server's ssl key

Running with SSL

After adding paths to your ssl certificate and key located on your server, socket.io should be accessible on https.

Note: Currently only supports either http or https, not both.

Client Side Configuration

See the offical Laravel documentation. https://laravel.com/docs/5.3/broadcasting#introduction

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.