Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.

WebSocket
&
Real-time revolution...

HTTP/1.1
(1999)

REST
(2000)

AJAX
(2005)

SSE
(2006)

WebSocket
(2008)

SPDY
(2010)

HTTP/2.0
(2015)

But we had some problems with HTTP!
It's good for Docs not Apps!

  1. Depends on Request/Response
    • Only client can send request
    • Server can only respond to client request
    • Can't send another request before response
  2. Too much traffic overhead and headers per each request.

Request header

Host: www.instagram.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:49.0) Gecko/20100101 Firefox/49.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Cookie: csrftoken=bU26o4NSvH3wan5ReiZoQ54fBPLifls6; sessionid=IGSC9f6d74746bafdf2716443d67e025762d5bb6730c854375e53366df295cbc5058%3AUQl5rsd6QNzTRe7RgayIs1xUrg8MLG2l%3A%7B%22_token_ver%22%3A2%2C%22_auth_user_id%22%3A1696839782%2C%22_token%22%3A%221696839782%3Ao94m97lrEK4ZDs1StRDuPtbHS5qcwvrb%3A0594e845155a3562206445077252d40986d2ac0333e8392597dc234b041ab73a%22%2C%22asns%22%3A%7B%22185.11.69.3%22%3A57357%2C%22time%22%3A1474736304%7D%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22last_refreshed%22%3A1474736304.756882%2C%22_platform%22%3A4%2C%22_auth_user_hash%22%3A%22%22%7D; mid=V9rmPQAEAAGOzLZQ3ZMU-6Uty4s4; ds_user_id=1696839782; ig_pr=1; ig_vw=1920
Connection: keep-alive
Upgrade-Insecure-Requests: 1
                
Length:~1KB (997B)

Response header

Cache-Control: private, no-cache, no-store, must-revalidate
Content-Encoding: gzip
Content-Language: en
Content-Length: 18311
Content-Type: text/html
Date: Sun, 25 Sep 2016 22:39:59 GMT
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Pragma: no-cache
Set-Cookie: csrftoken=bU26o4NSvH3wan5ReiZoQ54fBPLifls6; expires=Sun, 24-Sep-2017 22:39:59 GMT; Max-Age=31449600; Path=/; secure
s_network=; expires=Sun, 25-Sep-2016 23:39:59 GMT; Max-Age=3600; Path=/
sessionid=IGSC2207ce3e98db59722e6f7d0711f08dbe051841a30316da861000f959d58ad76e%3AD2w2vLhIJWsG0s46UC4BKu2FErus8es6%3A%7B%22_token_ver%22%3A2%2C%22_auth_user_id%22%3A1696839782%2C%22_token%22%3A%221696839782%3Ao94m97lrEK4ZDs1StRDuPtbHS5qcwvrb%3A0594e845155a3562206445077252d40986d2ac0333e8392597dc234b041ab73a%22%2C%22asns%22%3A%7B%22185.11.69.123%22%3A57357%2C%22time%22%3A1474843198%7D%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22last_refreshed%22%3A1474843199.976601%2C%22_platform%22%3A4%2C%22_auth_user_hash%22%3A%22%22%7D; expires=Sat, 24-Dec-2016 22:39:59 GMT; httponly; Max-Age=7776000; Path=/; secure
ds_user_id=1696839782; expires=Sat, 24-Dec-2016 22:39:59 GMT; Max-Age=7776000; Path=/
Strict-Transport-Security: max-age=86400
Vary: Cookie, Accept-Language, Accept-Encoding
X-Firefox-Spdy: h2
X-Frame-Options: SAMEORIGIN
                
Length:~1.3KB (1312B)
Total length:~2.3KB (2309B)
And there isn't only one request for each web app...

So, What are the differences?

In 2016 bidirectional client<->server communication can only be achieved with AJAX and/or WS

When you make an AJAX request you DON'T have to think about any thing,
But when you make a socket connection you have to think about every thing (Such as TCP,sub-protocols,data structure,...)!

What do we want from Real-time?

Sub-protocols

What are the solutions?

Language License
ReactPHP PHP MIT
Ratchet PHP MIT
dNode-PHP PHP MIT
phpDaemon PHP LGPL-3.0
Rocket (beta version) PHP GPL-3.0
Faye JavaScript(Node.JS) MIT
Faye JavaScript(Node.JS) MIT
Socket.IO (Engine.IO) JavaScript(Node.JS) MIT
Primus.IO JavaScript(Node.JS) MIT
em-websocket Ruby MIT
Faye Ruby MIT
SignalR C# Apache 2.0
XSockets C# Private Software
Netty Java Apache 2.0
Jetty Java Apache 2.0

Rocket

What is it?

Model

Smart caching system

Session Provider

Internationalization and Localization (I18N)

Debugging and Unit tests tools

Simple HTTP requests handling

Captcha

And many many more

Talk is cheap. Show me the code...
Linus Torvalds

How to install?


It's so simply just type in your command line

git clone https://github.com/qti3e/Rocket
        

Wanna contribute?


Good! Just go to GitHub repository, you know what to do.

https://github.com/QTI3E/Rocket
        

Any Questions?


Present by Alireza Ghadimi
(@Qti3e every where!)

Use a spacebar or arrow keys to navigate