Giter Club home page Giter Club logo

ws-xample's Introduction

Synopsis

Just an small example related with websockets implementation using GeniusesOfSymfony/WebSocketBundle

Requirements

  • Apache >= 2.4
  • PHP >= 5.6
  • Composer
  • Git
  • Bower

Instalation

  • Clone this repository
  • From the command-line:
:~$ cd ws-xample
:~$ composer install
:~$ bin/console doctrine:database:create
:~$ bin/console doctrine:schema:update --force
:~$ bin/console doctrine:migrations:execute 20171122055909 --no-interaction
:~$ cd web
:~$ bower install
  • Fix var directory permission. From the command line:
:~$ cd ws-xample
:~$ HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1)
:~$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX var
:~$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX var

Configure

  • Open app/config/parameters.yml file and update gos_client_session_handler value to session.handler.pdo
// app/config/parameters.yml
parameters:
    // ...
    gos_client_session_handler: 'session.handler.pdo'

Configure "wsxample" site in Apache

  • Add wsxample.loc to /etc/hosts:
# /etc/hosts
127.0.0.5         wsxample.loc
  • Add a new site in apache and configure as following:
<VirtualHost *:80>
    ServerName wsxample_dev

    ServerAlias wsxample.loc www.wsxample.loc 127.0.0.5

    DocumentRoot /path/to/ws-xample/web

    SetEnv ACCESS_SYMFONY_DEV 0

    <Directory /path/to/ws-xample/web>
        Options +FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all

        RewriteEngine On

        # Explicitly disable rewriting for front controllers
        RewriteRule ^app_dev.php - [L]
        RewriteRule ^app.php - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ app.php [QSA,L]
        # RewriteRule ^(.*)$ app_dev.php [QSA,L]
    </Directory>
</VirtualHost>

How to run websocket server

From the command line:

:~$ bin/console gos:websocket:server

Contributors

ws-xample's People

Contributors

allucardster avatar

Watchers

Vandro Neves dos Santos avatar

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.