30. ?
how many people know what comet is?
how many people know how it differs from XML socket or WebSocket?
good! for a long time i had no idea what comet was
36. I, too, am a
revolutionary web
technique you didnāt know
existed and can start using
today that will forever change
the way you imagine the
web experience.
āI, too, am a revolutionary web technique you didnāt know existed and can start using today
that will forever change the way you think about the web experience.ā
51. anyway, comet is any standards compliant technique which pushes or streams data to the
browser over HTTP
with comet you can essentially fake a socket connection between a browser and a backend
server
52. how about an example
well, for this yearās django dash
77. Zeddicus
8200
Browser Orbited
8100
sitting behind orbited we have our app-speciļ¬c comet code. for leafy chat it was a twisted-
based daemon named zeddicus. it handled all the IRC stuff - connecting to channels, sending
messages, receiving private messages, logging, all that
97. we ended up using a combination of django signals and json
98. Zeddius
Zeddicus
8200
Browser Orbited
8100
so this is our overview, except with one small change
99. Zeddius
Zeddicus
8200
Browser Orbited
8100
these are actually persistent connections
100. Zeddius
Zeddicus
8200
Browser Orbited
8100
between orbited and zeddicus itās a tcpsocket
101. Zeddius
Zeddicus
8200
Browser Orbited
8100
between the browser and orbited itās a comet technique
102. Zeddicus
Browser
8200
we jump through all these hoops because it allows us to write our app as if the browser is
connecting DIRECTLY to zeddicus via a tcpsocket
103. Zeddicus
Browser
8200
which is what the āreal timeā web is all about and what comet gives us
the browser writes to and reads from a socket, our back-end daemon does the same.
115. Zeddius
freenode
Zeddicus
8200
6667
Browser Orbited
8100
see, with orbited, you can connect directly to an irc server
and why not? itās just a socket connection
116. in fact you can demo a (somewhat functional) irc connection on the orbited website
117. Zeddius
Zeddicus
8200
Browser Orbited
8100
Zeddius
freenode
Zeddicus
8200
6667
but with leafychat we wrote our own backend daemon that connected to irc.
why?
119. Zeddius
Zeddicus
8200
Browser Orbited
8100
if we loaded our django code into zeddicus, we could easily log irc chats youāre interested in
based on your session id.
it works very well.
120. Django Orbited
8000
Browser Apache
80
Zeddius
8200
at this point i should mention the older tutorials online explaining how to load orbited into
django.
121. Apache Django
80 8000
Browser
Orbited Zeddicus
8100 8200
but i the best (and simplest) way is to let each component be its own daemon
it works great for production as well as dev mode - the django dash judges were able to start
and run our app locally, despite the number of daemons that needed to run
122. if you want to get a comet app up and running locally, check out orbited
it supports a ton of comet transports and is actively maintained
131. how? ļ¬ash allows you to make tcp connections in actionscript.
by providing a javascript api to those tcp connections, we can use ļ¬ash to create persistent,
socket connections from the browser
139. itās still a proposed draft
but itāll let you open a socket to any serve that speaks the special WebSocket protocol
140. ws://
servers need to speak the WebSocket protocol - you canāt open arbitrary connections to irc or
xmpp gateways
this plugs up the obvious security holes but also makes it a bit harder to implement than
something like XMLSocket
your server needs to speak ws