Your SlideShare is downloading. ×
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
XMPP with BOSH
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

XMPP with BOSH

25,541

Published on

Interested in how you could use XMPP on the web? This presentation discusses some of the basics for using BOSH as a transport. This presentation was given at Izea and was Adobe Developers of Greater …

Interested in how you could use XMPP on the web? This presentation discusses some of the basics for using BOSH as a transport. This presentation was given at Izea and was Adobe Developers of Greater Orlando User-group.

Published in: Technology
0 Comments
19 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
25,541
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
443
Comments
0
Likes
19
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Intro to BOSH using Javascript (Bidirectional-streams Over Synchronous HTTP) Adam Fortuna Initial setup: Open up ejabberd webpage. Open strophe documentation webpage. Open PSI webpage. Open up apache config, and echobot.
  • 2. What is BOSH again? When you think BOSH, you should think XMPP. BOSH, fully spelled out as Bidirectional- streams Over Synchronous HTTP, is a standard that enables you to use an XMPP server over HTTP. If you’ve ever heard about XMPP, it’s probably been in the context of some server side language that was using it — Ruby, Python, Erlang, etc. That’s because they can open up a connection to the XMPP server using the Jabber protocol. In some situations, such as within a web browser, this isn’t possible. That’s where BOSH comes in. Instead of connecting directly from javascript to an XMPP server, the XMPP server can expose an HTTP endpoint, like http:// example.org:5218/http-bind. XMPP messages can be sent to this URL as if it were the XMPP server. That enables a client to authenticate against the server, get a roster list and everything else XMPP allows. In this talk we’ll be going over some of the basics of XMPP, how to get a BOSH server setup, just how close to realtime it actually is and the ideas behind using it rather than polling. If you’re thinking about using XMPP, or have a need for near-realtime communication it should be interesting.
  • 3. What can you do with XMPP? Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 4. What can you do with XMPP? Authentication Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 5. What can you do with XMPP? Authentication Presence Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 6. What can you do with XMPP? Authentication Presence Contact Lists Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 7. What can you do with XMPP? Authentication Presence Contact Lists One-to-one messaging Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 8. What can you do with XMPP? Authentication Presence Contact Lists One-to-one messaging Multi-party messaging Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 9. What can you do with XMPP? Authentication Encryption Presence Contact Lists One-to-one messaging Multi-party messaging Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 10. What can you do with XMPP? Authentication Encryption Presence Service Discovery Contact Lists One-to-one messaging Multi-party messaging Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 11. What can you do with XMPP? Authentication Encryption Presence Service Discovery Contact Lists Forms, Workflows One-to-one messaging Multi-party messaging Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 12. What can you do with XMPP? Authentication Encryption Presence Service Discovery Contact Lists Forms, Workflows One-to-one messaging Media sessions Multi-party messaging Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 13. What can you do with XMPP? Authentication Encryption Presence Service Discovery Contact Lists Forms, Workflows One-to-one messaging Media sessions Multi-party messaging Arbitrary Messages Applications: Instant messaging, groupchat, gaming (combine one-to-one, multi-party messaging), systems control (possible to deploy lightweight systems for control of and interaction with remote systems - give redgreen peepcode example). Geolocation xmpp messages with lat/lng. Data syndication (twitter could push data to an xmpp stream that others could subscribe to). VoIP (gtalk). Single sign on (using jabber ids).
  • 14. How about BOSH?
  • 15. Same thing! If you can do it with XMPP, you can do it with BOSH BOSH is just exposing that XMPP connection with HTTP. There are some limitations on message size unfortunately though (from what I understand), so binary data isn’t the best idea over BOSH.
  • 16. How’s it work? Show BOSH example. 1) Initial setup. Open up ejabberd page. Open up apache config. Start ejabberd server. (admin@yuugi.local/testing). Explain how ejabberd users are the center of everything. 2) Open up PSI and connect as a sample user to show xmpp server is running. Show the resource I was logged in with. 3) Open up echobot and connect.
  • 17. What’s gained with BOSH? Transport over HTTP instead of jabber protocol. Allows applications to scale up using XMPP. Jabber servers can handle TONS of concurrent users. Apache ~5k, Nginx ~9k. Imagine 9k people polling a web app every 3 seconds -- not a pretty picture. Can be used in situations where jabber isn’t available (like hotels, etc). Doesn’t lose data! Messages will be stored on the server and sent when when the client is there. Ever talk on AIM and have someone disconnect and not know what the last message received was? Doesn’t happen with XMPP, so doesn’t happen with BOSH. Great for unreliable connections. Can go ofline and come back online (like if you were moving between networks) and bosh will hide it. If apache/nginx is setup to be gzipped, all xmpp stanza’s will be gzipped as well.
  • 18. A few things to consider...
  • 19. Cross Domain?
  • 20. Cross Domain? script src=”http://api.twitter.com/json/adamfortuna/ timeline?callback=myTweets” /
  • 21. Cross Domain? script src=”http://api.twitter.com/json/adamfortuna/ timeline?callback=myTweets” / myTweets({username:adamfortuna, tweets:[...]})
  • 22. Cross Domain? script src=”http://api.twitter.com/json/adamfortuna/ timeline?callback=myTweets” / myTweets({username:adamfortuna, tweets:[...]}) script src=”http://localhost/htp-bind/xmpp message/” /
  • 23. Cross Domain? script src=”http://api.twitter.com/json/adamfortuna/ timeline?callback=myTweets” / myTweets({username:adamfortuna, tweets:[...]}) script src=”http://localhost/htp-bind/xmpp message/” / _BOSH_(“xmpp response /”)
  • 24. XMPP Payload Can be anything! You could make a microblogging service like twitter and using atom as the messages sent back and forth.
  • 25. Strophe Example... Show strophe documentation page.
  • 26. Strophe Example... $iq({type: 'get'}) .c('query', {xmlns: Strophe.NS.ROSTER}) .toString() Show strophe documentation page.
  • 27. Strophe Example... $iq({type: 'get'}) .c('query', {xmlns: Strophe.NS.ROSTER}) .toString() iq type=’get’ query xmlns=’jabber:iq:roster’/ /iq Show strophe documentation page.
  • 28. Authentication Explain authentication in example. Explain connection.attach(BOSH_JID, BOSH_SID, BOSH_RID, onConnect);
  • 29. So who’s using BOSH? Chesspark: Chess game where messages are sent back and forth containing chess moves. Speeqe: Chat servers Yammer: Twitter for business seesmic: twitter for video Izea...? Lots more using XMPP. Bosh standard is extremely new, and the libraries are just getting up to speed with it.
  • 30. Next Step with XMPP? BOSH just might be the next big space for XMPP to move into.
  • 31. References • http://xmpp.org/ • http://metajack.im • http://people.chesspark.com/~jack/strophe- preview/doc/files/strophe-js.html • http://code.stanziq.com/strophe/ • http://www.ejabberd.im/ • http://www.amazon.com/XMPP-Definitive-Guide-Peter-Saint-Andre/dp/059652126X/ref=pd_bbs_sr_2? ie=UTF8s=booksqid=1231469854sr=8-2

×