Enviar pesquisa
Carregar
Cowboy rabbit-websockets
•
1 gostou
•
4,941 visualizações
Wade Mealing
Seguir
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 45
Baixar agora
Baixar para ler offline
Recomendados
Websocket 101 in Python
Websocket 101 in Python
Juti Noppornpitak
dotNetConf2019
dotNetConf2019
Andrea Tosato
Alex carcea, radu macovei a story of how java script joined the big league
Alex carcea, radu macovei a story of how java script joined the big league
Codecamp Romania
Using Websockets in Play !
Using Websockets in Play !
Knoldus Inc.
Ruby C10K: High Performance Networking - RubyKaigi '09
Ruby C10K: High Performance Networking - RubyKaigi '09
Ilya Grigorik
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
tdc-globalcode
SPDY
SPDY
Andreas Bjärlestam
Liberating the Black Box - Real-Time Communications for the Internet of Things
Liberating the Black Box - Real-Time Communications for the Internet of Things
Peter Moskovits
Mais conteúdo relacionado
Mais procurados
Communication in Python and the C10k problem
Communication in Python and the C10k problem
Jose Galarza
Websocket protocol overview
Websocket protocol overview
allenmeng
A look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architecture
Aimee Maree Forsstrom
PHP and FastCGI Performance Optimizations
PHP and FastCGI Performance Optimizations
Alessandro Pilotti
HTTP/2 and SAP Fiori
HTTP/2 and SAP Fiori
Sascha Wenninger
Smuggling TCP traffic through HTTP
Smuggling TCP traffic through HTTP
Dávid Halász
Building Desktop RIAs with JavaScript and PHP - ZendCon09
Building Desktop RIAs with JavaScript and PHP - ZendCon09
funkatron
SPDY - or maybe HTTP2.0
SPDY - or maybe HTTP2.0
Andreas Bjärlestam
Websockets at tossug
Websockets at tossug
clkao
Php Performance On Windows
Php Performance On Windows
ruslany
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
Jackson F. de A. Mafra
Zendcon magento101
Zendcon magento101
Mathew Beane
Implement server push in flask framework
Implement server push in flask framework
Chi-Chia Huang
Open web mail setup
Open web mail setup
Chacheng Oo
T3DD12 Caching with Varnish
T3DD12 Caching with Varnish
AOE
PHP Custom Web application development
PHP Custom Web application development
Marion Welch
Perl ides
Perl ides
Naim Shafiev
Tomcat openssl
Tomcat openssl
Jean-Frederic Clere
Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010
sullis
Word press workflows and gulp
Word press workflows and gulp
Eli McMakin
Mais procurados
(20)
Communication in Python and the C10k problem
Communication in Python and the C10k problem
Websocket protocol overview
Websocket protocol overview
A look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architecture
PHP and FastCGI Performance Optimizations
PHP and FastCGI Performance Optimizations
HTTP/2 and SAP Fiori
HTTP/2 and SAP Fiori
Smuggling TCP traffic through HTTP
Smuggling TCP traffic through HTTP
Building Desktop RIAs with JavaScript and PHP - ZendCon09
Building Desktop RIAs with JavaScript and PHP - ZendCon09
SPDY - or maybe HTTP2.0
SPDY - or maybe HTTP2.0
Websockets at tossug
Websockets at tossug
Php Performance On Windows
Php Performance On Windows
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
Zendcon magento101
Zendcon magento101
Implement server push in flask framework
Implement server push in flask framework
Open web mail setup
Open web mail setup
T3DD12 Caching with Varnish
T3DD12 Caching with Varnish
PHP Custom Web application development
PHP Custom Web application development
Perl ides
Perl ides
Tomcat openssl
Tomcat openssl
Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010
Word press workflows and gulp
Word press workflows and gulp
Semelhante a Cowboy rabbit-websockets
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the Web
Peter Lubbers
WebSockets On Fire
WebSockets On Fire
Jef Claes
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Viktor Gamov
Pushing the web — WebSockets
Pushing the web — WebSockets
Roland M
Ws
Ws
Sunghan Kim
Socket.io
Socket.io
Diego Pacheco
The HTML5 WebSocket API
The HTML5 WebSocket API
David Lindkvist
Progressive Enhancement
Progressive Enhancement
Zach Leatherman
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet
Richard Banks
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Edgar Silva
WebSockets in JEE 7
WebSockets in JEE 7
Shahzad Badar
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web Developers
Sascha Corti
Web sockets - Pentesting
Web sockets - Pentesting
Vandana Verma
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket
brent bucci
Owasp AppSecEU 2015 - BeEF Session
Owasp AppSecEU 2015 - BeEF Session
Bart Leppens
DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5
Eyal Vardi
Building Real-Time Applications in Ember.js
Building Real-Time Applications in Ember.js
Steve Kinney
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
Mark West
Ibm tivoli access manager for e business tracing http connections redp4622
Ibm tivoli access manager for e business tracing http connections redp4622
Banking at Ho Chi Minh city
Connected Web Systems
Connected Web Systems
Damir Dobric
Semelhante a Cowboy rabbit-websockets
(20)
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the Web
WebSockets On Fire
WebSockets On Fire
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Pushing the web — WebSockets
Pushing the web — WebSockets
Ws
Ws
Socket.io
Socket.io
The HTML5 WebSocket API
The HTML5 WebSocket API
Progressive Enhancement
Progressive Enhancement
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
WebSockets in JEE 7
WebSockets in JEE 7
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web Developers
Web sockets - Pentesting
Web sockets - Pentesting
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket
Owasp AppSecEU 2015 - BeEF Session
Owasp AppSecEU 2015 - BeEF Session
DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5
Building Real-Time Applications in Ember.js
Building Real-Time Applications in Ember.js
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
Ibm tivoli access manager for e business tracing http connections redp4622
Ibm tivoli access manager for e business tracing http connections redp4622
Connected Web Systems
Connected Web Systems
Último
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
IES VE
SheDev 2024
SheDev 2024
GDSC PJATK
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4
DianaGray10
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Alkin Tezuysal
Top 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
TopCSSGallery
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
xtailishbaloch
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptx
Satishbabu Gunukula
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024
Brian Pichman
UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3
DianaGray10
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...
DianaGray10
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
Safe Software
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx
Hansamali Gamage
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4j
Neo4j
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
Neo4j
From the origin to the future of Open Source model and business
From the origin to the future of Open Source model and business
Francesco Corti
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
ThousandEyes
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First Frame
Kapil Thakar
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdf
Infopole1
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data
Eric D. Schabell
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
ThousandEyes
Último
(20)
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
SheDev 2024
SheDev 2024
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Top 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptx
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024
UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4j
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
From the origin to the future of Open Source model and business
From the origin to the future of Open Source model and business
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First Frame
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdf
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Cowboy rabbit-websockets
1.
Erlang + Message Queue + HTML 5
Tech
2.
= Over-engineered Chat Server
3.
What Cowboy ? https://github.com/extend/cowboy Small, fast
modular web server written in erlang.
4.
What Gen Bunny https://github.com/mochi/gen_bunny RabbitMQ client
library for simple pubsub in erlang.
5.
What Websocket ? https://www.websocket.org/ Bi-directional web
communication mechanism.
6.
Over Architecturing You want
it. I deliver !
7.
Server Moving parts Cowboy Gen Bunny Browser
8.
Client Moving parts Cowboy Gen Bunny Browser
9.
Websockets Technical Detour
10.
Client Moving parts BrowserBrowser Server HTTP Port 80Port
80
11.
Client Moving parts BrowserBrowser Server WS UpgradeUpgradePort 80Port
80
12.
WHY ? WORKS WITH EXISTING PROXIES
13.
Client JS Data is
live chat stream
14.
JS Connection wsUrl =
"ws://server:8081/websocket"; websocket = new WebSocket(wsUrl);
15.
Websocket Setup websocket =
new WebSocket(wsURL); websocket.onopen = ... websocket.onmessage = function(evt){ onMessage(e) }; websocket.onerror = ...
16.
onMessage Handler function onMessage(e)
{ Msg = '<p>' + txt + '</p>' $('#output').prepend(Msg); };
17.
Smooth Yeah
18.
Server Side Server WS
19.
Cowboy What comes to mind
?
20.
Kid Rock
21.
Fresh Leather
22.
Pretty Lil' web
server
23.
Cowboy Routes, REST, middleware, web
sockets and more.
24.
Cowboy follows OTP principals.
25.
Cowboy WS Required Callbacks init websocket_init websocket_handle websocket_info websocket_terminate
26.
Cowboy WS init Upgrades from http
→ web socket
27.
Cowboy WS init({tcp, http},
_Req, _Opts) → {upgrade,protocol,cowboy_websocket}.
28.
Cowboy WS websocket_init Run on
each connection.
29.
Cowboy WS websocket_init(_Name, Req,
_Opts) → Pid = consumer:start_link(), {ok, Req, #state{pid=Pid}}.
30.
Cowboy WS websocket_handle Recv data
from client, optionally return data.
31.
Cowboy WS websocket_handle(Data, Req,
State) → {text, Msg} = Data, {reply, {text, << "recv: ", Msg/binary >>}, Req, State};
32.
Cowboy WS websocket_info Live Push
data to client
33.
Cowboy WS websocket_info(Data, Req,
State) → {reply, {text, Data}, Req,State};
34.
Sending to RabbitMQ RabbitMQ websocket_handle
35.
Recv from RabbitMQ RabbitMQ websocket_info gen_bunny CONSUMER
36.
Message Queues gen bunny
37.
gen_bunny follows OTP principals.
38.
callbacks Required: ● handle_message ● init ●
handle_call ● handle_cast ● handle_info ● terminate
39.
callbacks handle_message Handle messages from
the message subscribed message queue.
40.
callbacks handle_message(Msg, State) → NewState
= act_on_msg(Msg,State) {noreply, NewState};
41.
MQ perspective Exchange Exchange “Fanout” MSG MSG MSG MSG MSG MSG MSG MSG MSG MSG MSG MSG
42.
Live demo Wireless Network: Name:
rabbit Password: carrot VISIT: http://10.1.1.1:8081/
43.
Benchmarking Method: Connect to Websocket Wait
for signal. Send 100 messages. Receive all messages
44.
Benchmarking Results: (Didn't get this
done in time, sorry) 0.5 1 1.5 2 2.5 3 3.5 4 4.5 0 2 4 6 8 10 12 Column 1 Column 2 Column 3
45.
Source Code github.com/wmealing/ bunny-cowboy-websocket
Baixar agora