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

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Kürzlich hochgeladen (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

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. ;)