From a35a9095c5b2fdb0805f1bc4c50a1ea26371dd99 Mon Sep 17 00:00:00 2001 From: Sef Date: Wed, 15 Nov 2017 14:57:30 +0300 Subject: [PATCH] Created Websocket usage (markdown) --- Websocket-usage.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Websocket-usage.md diff --git a/Websocket-usage.md b/Websocket-usage.md new file mode 100644 index 0000000..263f17d --- /dev/null +++ b/Websocket-usage.md @@ -0,0 +1,23 @@ +We use websocket in our project. For now on its only in the wall, however feel free to use it anywhere in the project where its actually applicable. + +## General information +On frontend, you can use autobahn.js or whatever you want to communicate to websocket. +On backend, you can use [Ratchet](http://socketo.me/) as its already installed in the project. + +## NGINX config +` +location /ws/ { + proxy_pass http://127.0.0.1:8080; + proxy_read_timeout 1200s; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; +} +` + +## Wall usage +In wall, we use it to have real time updates on: +* new messages +* edited messages +* deleted messages +* blocked messages