SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
Mongoose
Citizen of the World (Wide Web)
Who are you?
Webmaster of social site?
Desginer of corporate page?
Backend developer?
Geek with full stomach after lunch?
How can you embed a chat?
Combine PHP, JavaScript and storing
messages in MySQL.
Use existing plugin/library and external
chat server.
Make custom server with REST/Websockets
interface.
Or...
Host your own chat
All you need is dedicated server where
you can install Erlang, MongooseIM and
open chosen ports in firewall.
May use the server with webpage.
Integrate existing JavaScript XMPP
libraries with MongooseIM BOSH and
Websockets endpoints.
Why XMPP?
Proven, popular protocol
Lots of extensions
Many server and client implementations
Easy to comprehend:
<message from=”john@example.com/macbook”
to=”alice@example.com/nokia”>
<body>Hello Alice!</body>
</message>
XEP-0239: Binary XMPP
• Traditional stanza: <presence/>
• Binary representation:
00111100011100000111001001100101011100110110
01010110111001100011011001010010111100111110
• Binary XMPP representation:
<zero/><zero/><one/><one/><one/><one/><zero/><zero/>
<zero/><one/><one/><one/><zero/><zero/><zero/><zero/>
<zero/><one/><one/><one/><zero/><zero/><one/><zero/>
<zero/><one/><one/><zero/><zero/><one/><zero/><one/>
<zero/><one/><one/><one/><zero/><zero/><one/><one/>
<zero/><one/><one/><zero/><zero/><one/><zero/><one/>
<zero/><one/><one/><zero/><one/><one/><one/><zero/>
<zero/><one/><one/><zero/><zero/><zero/><one/><one/>
<zero/><one/><one/><zero/><zero/><one/><zero/><one/>
<zero/><zero/><one/><zero/><one/><one/><one/><one/>
<zero/><zero/><one/><one/><one/><one/><one/><zero/>
Our little carnivore
Very strong claws to
dig through lots of
messages
Able to deal with
multiple meals servers
in cluster
Adopts very well to
Eurasian and African
modern Web environment.
Getting Mongoose
Download package from ESL website or repo
Clone git repository:
https://github.com/esl/ejabberd
Mongoose’s reflex
Server:
AMD FX-8150 8x3.3GHz
32GB RAM
One big room:
3000 users
10 messages per second
Multiple rooms:
2000 rooms
25 users/room
0.6 message per second per room
Case Study: Erlang Central
Erlang Factory streams
Groupchats for live streams were first.
Use MUCkl (with JSJaC as backend)
embedded in a very straightforward way
(<iframe>).
Taps into Wordpress cookies and uses them
for authenticating users.
Client-side
Connects to MongooseIM via Websockets
Authenticates with user login and
Wordpress ‘logged in cookie’
Cookie format:
piotr_nosek|1368010779|49aa66843380c377e93b198b966eb699
user login exp. date magic hash
Steps to create magic hash
1. Frag = password_hash[8:11]
2. HMACKey = logged_in_key + logged_in_salt
3. HMACData = username + Frag + ‘|’ + ExpTime
4. HMAC = hmac(md5, HMACData, HMACKey)
5. MagicHash = hmac(md5, username + ‘|’ +
ExpTime, HMAC)
Server-side module
ejabberd_auth_wordpress.erl
Reproduces Wordpress ‘logged in cookie’
Compares it with provided password
(cookie)
Generated from user password hash
fragment, user login, expiration date and
salt defined by administrator
Facebook-like global groupchat
Uses xmpptk (with JSJaC backend, like
stream chats)
Chosen BOSH instead of Websockets
Websockets are closed on page reload
Test drive for MongooseIM reimplemented
BOSH support
Case Study: Erlang Central
Erlang Central Cafe
Client-side
Uses cookie generated in similar way to
‘logged in cookie’.
Modified xmpptk and jQuery chat box to
fit into Wordpress plugin and match
Erlang Central look and feel.
Server-side
Compares password (cookie) against
generated hash.
New BOSH implementation.
For 3rd party clients: hashes password
with Erlang implementation of phpass and
checks against hash stored in DB.
(Side) Effects of
Erlang Central chats
Real application for Websockets and new BOSH
support
People watching stream have a way of telling
camera guy to show slides, not just speaker face.
:)
Modules for integrating Erlang with Wordpress
and/or PHP:
Cafe plugin
phpass implementation
Useful links
MongooseIM load tests - full article
http://soerlang.tumblr.com/post/35563581435/esl-
mongooseim-vs-p1-ejabberd-part-i-piotr-nosek
MUCkl
https://github.com/sstrigler/MUCkl
xmpptk
https://github.com/sstrigler/xmpptk
Wordpress auth for MongooseIM:
https://github.com/esl/ejabberd, ‘wordpress’ branch
Cafe plugin: To Be Released
Detailed tutorials (self-advertisement ;))
http://getcookie.wordpress.com
Thank you!
Köszönöm!
And see you again in erlang:get_cookie() blog. ;)

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Kürzlich hochgeladen (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Empfohlen

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Empfohlen (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Mongooze citizen

  • 1. Mongoose Citizen of the World (Wide Web)
  • 2. Who are you? Webmaster of social site? Desginer of corporate page? Backend developer? Geek with full stomach after lunch?
  • 3. How can you embed a chat? Combine PHP, JavaScript and storing messages in MySQL. Use existing plugin/library and external chat server. Make custom server with REST/Websockets interface. Or...
  • 4. Host your own chat All you need is dedicated server where you can install Erlang, MongooseIM and open chosen ports in firewall. May use the server with webpage. Integrate existing JavaScript XMPP libraries with MongooseIM BOSH and Websockets endpoints.
  • 5. Why XMPP? Proven, popular protocol Lots of extensions Many server and client implementations Easy to comprehend: <message from=”john@example.com/macbook” to=”alice@example.com/nokia”> <body>Hello Alice!</body> </message>
  • 6. XEP-0239: Binary XMPP • Traditional stanza: <presence/> • Binary representation: 00111100011100000111001001100101011100110110 01010110111001100011011001010010111100111110 • Binary XMPP representation: <zero/><zero/><one/><one/><one/><one/><zero/><zero/> <zero/><one/><one/><one/><zero/><zero/><zero/><zero/> <zero/><one/><one/><one/><zero/><zero/><one/><zero/> <zero/><one/><one/><zero/><zero/><one/><zero/><one/> <zero/><one/><one/><one/><zero/><zero/><one/><one/> <zero/><one/><one/><zero/><zero/><one/><zero/><one/> <zero/><one/><one/><zero/><one/><one/><one/><zero/> <zero/><one/><one/><zero/><zero/><zero/><one/><one/> <zero/><one/><one/><zero/><zero/><one/><zero/><one/> <zero/><zero/><one/><zero/><one/><one/><one/><one/> <zero/><zero/><one/><one/><one/><one/><one/><zero/>
  • 7. Our little carnivore Very strong claws to dig through lots of messages Able to deal with multiple meals servers in cluster Adopts very well to Eurasian and African modern Web environment.
  • 8. Getting Mongoose Download package from ESL website or repo Clone git repository: https://github.com/esl/ejabberd
  • 9. Mongoose’s reflex Server: AMD FX-8150 8x3.3GHz 32GB RAM One big room: 3000 users 10 messages per second Multiple rooms: 2000 rooms 25 users/room 0.6 message per second per room
  • 10. Case Study: Erlang Central Erlang Factory streams Groupchats for live streams were first. Use MUCkl (with JSJaC as backend) embedded in a very straightforward way (<iframe>). Taps into Wordpress cookies and uses them for authenticating users.
  • 11. Client-side Connects to MongooseIM via Websockets Authenticates with user login and Wordpress ‘logged in cookie’ Cookie format: piotr_nosek|1368010779|49aa66843380c377e93b198b966eb699 user login exp. date magic hash
  • 12. Steps to create magic hash 1. Frag = password_hash[8:11] 2. HMACKey = logged_in_key + logged_in_salt 3. HMACData = username + Frag + ‘|’ + ExpTime 4. HMAC = hmac(md5, HMACData, HMACKey) 5. MagicHash = hmac(md5, username + ‘|’ + ExpTime, HMAC)
  • 13. Server-side module ejabberd_auth_wordpress.erl Reproduces Wordpress ‘logged in cookie’ Compares it with provided password (cookie) Generated from user password hash fragment, user login, expiration date and salt defined by administrator
  • 14. Facebook-like global groupchat Uses xmpptk (with JSJaC backend, like stream chats) Chosen BOSH instead of Websockets Websockets are closed on page reload Test drive for MongooseIM reimplemented BOSH support Case Study: Erlang Central Erlang Central Cafe
  • 15. Client-side Uses cookie generated in similar way to ‘logged in cookie’. Modified xmpptk and jQuery chat box to fit into Wordpress plugin and match Erlang Central look and feel.
  • 16. Server-side Compares password (cookie) against generated hash. New BOSH implementation. For 3rd party clients: hashes password with Erlang implementation of phpass and checks against hash stored in DB.
  • 17. (Side) Effects of Erlang Central chats Real application for Websockets and new BOSH support People watching stream have a way of telling camera guy to show slides, not just speaker face. :) Modules for integrating Erlang with Wordpress and/or PHP: Cafe plugin phpass implementation
  • 18. Useful links MongooseIM load tests - full article http://soerlang.tumblr.com/post/35563581435/esl- mongooseim-vs-p1-ejabberd-part-i-piotr-nosek MUCkl https://github.com/sstrigler/MUCkl xmpptk https://github.com/sstrigler/xmpptk Wordpress auth for MongooseIM: https://github.com/esl/ejabberd, ‘wordpress’ branch Cafe plugin: To Be Released Detailed tutorials (self-advertisement ;)) http://getcookie.wordpress.com
  • 19. Thank you! Köszönöm! And see you again in erlang:get_cookie() blog. ;)