MongooseCitizen 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 storingmessages in MySQL.Use existing plugin/library and externalchat...
Host your own chatAll you need is dedicated server whereyou can install Erlang, MongooseIM andopen chosen ports in firewal...
Why XMPP?Proven, popular protocolLots of extensionsMany server and client implementationsEasy to comprehend:<message from=...
XEP-0239: Binary XMPP• Traditional stanza: <presence/>• Binary representation:00111100011100000111001001100101011100110110...
Our little carnivoreVery strong claws todig through lots ofmessagesAble to deal withmultiple meals serversin clusterAdopts...
Getting MongooseDownload package from ESL website or repoClone git repository:https://github.com/esl/ejabberd
Mongoose’s reflexServer:AMD FX-8150 8x3.3GHz32GB RAMOne big room:3000 users10 messages per secondMultiple rooms:2000 rooms...
Case Study: Erlang CentralErlang Factory streamsGroupchats for live streams were first.Use MUCkl (with JSJaC as backend)em...
Client-sideConnects to MongooseIM via WebsocketsAuthenticates with user login andWordpress ‘logged in cookie’Cookie format...
Steps to create magic hash1. Frag = password_hash[8:11]2. HMACKey = logged_in_key + logged_in_salt3. HMACData = username +...
Server-side moduleejabberd_auth_wordpress.erlReproduces Wordpress ‘logged in cookie’Compares it with provided password(coo...
Facebook-like global groupchatUses xmpptk (with JSJaC backend, likestream chats)Chosen BOSH instead of WebsocketsWebsocket...
Client-sideUses cookie generated in similar way to‘logged in cookie’.Modified xmpptk and jQuery chat box tofit into Wordpr...
Server-sideCompares password (cookie) againstgenerated hash.New BOSH implementation.For 3rd party clients: hashes password...
(Side) Effects ofErlang Central chatsReal application for Websockets and new BOSHsupportPeople watching stream have a way ...
Useful linksMongooseIM load tests - full articlehttp://soerlang.tumblr.com/post/35563581435/esl-mongooseim-vs-p1-ejabberd-...
Thank you!Köszönöm!And see you again in erlang:get_cookie() blog. ;)
Upcoming SlideShare
Loading in...5
×

Mongooze citizen

1,431

Published on

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,431
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Mongooze citizen

  1. 1. MongooseCitizen of the World (Wide Web)
  2. 2. Who are you?Webmaster of social site?Desginer of corporate page?Backend developer?Geek with full stomach after lunch?
  3. 3. How can you embed a chat?Combine PHP, JavaScript and storingmessages in MySQL.Use existing plugin/library and externalchat server.Make custom server with REST/Websocketsinterface.Or...
  4. 4. Host your own chatAll you need is dedicated server whereyou can install Erlang, MongooseIM andopen chosen ports in firewall.May use the server with webpage.Integrate existing JavaScript XMPPlibraries with MongooseIM BOSH andWebsockets endpoints.
  5. 5. Why XMPP?Proven, popular protocolLots of extensionsMany server and client implementationsEasy to comprehend:<message from=”john@example.com/macbook”to=”alice@example.com/nokia”><body>Hello Alice!</body></message>
  6. 6. XEP-0239: Binary XMPP• Traditional stanza: <presence/>• Binary representation:0011110001110000011100100110010101110011011001010110111001100011011001010010111100111110• 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. 7. Our little carnivoreVery strong claws todig through lots ofmessagesAble to deal withmultiple meals serversin clusterAdopts very well toEurasian and Africanmodern Web environment.
  8. 8. Getting MongooseDownload package from ESL website or repoClone git repository:https://github.com/esl/ejabberd
  9. 9. Mongoose’s reflexServer:AMD FX-8150 8x3.3GHz32GB RAMOne big room:3000 users10 messages per secondMultiple rooms:2000 rooms25 users/room0.6 message per second per room
  10. 10. Case Study: Erlang CentralErlang Factory streamsGroupchats for live streams were first.Use MUCkl (with JSJaC as backend)embedded in a very straightforward way(<iframe>).Taps into Wordpress cookies and uses themfor authenticating users.
  11. 11. Client-sideConnects to MongooseIM via WebsocketsAuthenticates with user login andWordpress ‘logged in cookie’Cookie format:piotr_nosek|1368010779|49aa66843380c377e93b198b966eb699user login exp. date magic hash
  12. 12. Steps to create magic hash1. Frag = password_hash[8:11]2. HMACKey = logged_in_key + logged_in_salt3. HMACData = username + Frag + ‘|’ + ExpTime4. HMAC = hmac(md5, HMACData, HMACKey)5. MagicHash = hmac(md5, username + ‘|’ +ExpTime, HMAC)
  13. 13. Server-side moduleejabberd_auth_wordpress.erlReproduces Wordpress ‘logged in cookie’Compares it with provided password(cookie)Generated from user password hashfragment, user login, expiration date andsalt defined by administrator
  14. 14. Facebook-like global groupchatUses xmpptk (with JSJaC backend, likestream chats)Chosen BOSH instead of WebsocketsWebsockets are closed on page reloadTest drive for MongooseIM reimplementedBOSH supportCase Study: Erlang CentralErlang Central Cafe
  15. 15. Client-sideUses cookie generated in similar way to‘logged in cookie’.Modified xmpptk and jQuery chat box tofit into Wordpress plugin and matchErlang Central look and feel.
  16. 16. Server-sideCompares password (cookie) againstgenerated hash.New BOSH implementation.For 3rd party clients: hashes passwordwith Erlang implementation of phpass andchecks against hash stored in DB.
  17. 17. (Side) Effects ofErlang Central chatsReal application for Websockets and new BOSHsupportPeople watching stream have a way of tellingcamera guy to show slides, not just speaker face.:)Modules for integrating Erlang with Wordpressand/or PHP:Cafe pluginphpass implementation
  18. 18. Useful linksMongooseIM load tests - full articlehttp://soerlang.tumblr.com/post/35563581435/esl-mongooseim-vs-p1-ejabberd-part-i-piotr-nosekMUCklhttps://github.com/sstrigler/MUCklxmpptkhttps://github.com/sstrigler/xmpptkWordpress auth for MongooseIM:https://github.com/esl/ejabberd, ‘wordpress’ branchCafe plugin: To Be ReleasedDetailed tutorials (self-advertisement ;))http://getcookie.wordpress.com
  19. 19. Thank you!Köszönöm!And see you again in erlang:get_cookie() blog. ;)
  1. ¿Le ha llamado la atención una diapositiva en particular?

    Recortar diapositivas es una manera útil de recopilar información importante para consultarla más tarde.

×