SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
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. ;)

Contenu connexe

Dernier

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
[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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

En vedette

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
 

En vedette (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. ;)