Git Product home page Git Product logo

testmarkdown-test's Introduction

Websocket chat configuration

Chat application is built on:

Chat configuration

Project configs

It is required to set payever.base_host parameter to correct value in the file app/config/parameters.private.yml

payever.base_host = www.payever.local

If the foolowing line does not exist in app/config/parameters.specific.yml it is required to add (assuming)

payever_messenger.client_ws_url: "ws://%payever.base_host%%gos_web_socket.suffix%"

Supervisor

To run chat application is required a permanent console script - ./symfony gos:websocket:server. It is convenient to run that daemon script using supervisor. Configuration example:

#/etc/supervisor/conf.d/websocket.conf

[program:websocket]
command=/local/project/path/symfony gos:we:se
directory=/local/project/path/
autostart=true
autorestart=true
startretries=3
stderr_logfile=/var/log/supervisor/websocket.log
stdout_logfile=/var/log/supervisor/websocket.log
user=peton
#environment=

Start websocket supervisor daemon:

sudo supervisorctl start websocket

To see websocket server logs it is required to run

sudo supervisorctl tail -f websocket

Duting chat application development it is sometimes required to restart websocket daemon. It can be done by:

sudo supervisorctl restart websocket

Apache vhost

It is required to add the following line in <VirtualHost *:80>:

ProxyPass "/chat/" "ws://127.0.0.1:1337"

It is required to enable Apache proxy module:if it is not done yet

sudo a2enmod proxy

Nginx configuration

Add:

#websockets chat
    location /chat {
        proxy_pass http://localhost:1337;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

to run websocket server with wss you need certificates, and nginx/apache configured to run in http/https

server {
        listen   443 ssl;
        server_name payever.local;

        ssl_certificate /usr/local/etc/nginx/ssl/nginx.crt;
        ssl_certificate_key /usr/local/etc/nginx/ssl/nginx.key;
        ssl on;

        rewrite     ^   http://$host$request_uri?;
}

testmarkdown-test's People

Contributors

peter31 avatar

Watchers

 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.