WebSockets support now available

9 views
Skip to first unread message

Marc Worrell

unread,
Jan 25, 2010, 9:53:22 AM1/25/10
to zotonic-d...@googlegroups.com, zotoni...@googlegroups.com
Hello,

I've just committed WebSockets support to Zotonic.

When WebSockets is available then it is used as a replacement for the Comet long poll.
You start a WebSockets connection by including the {% stream %} tag in your template.
This tag must be placed before the {% script %} tag.

For this I renamed the scomp {% comet %} to {% stream %}. Please update your templates.

Inside Zotonic you can send a script to the current web page using, for example:

z_session_page:add_script("alert('hello world');", Context)

The WebSockets supports will be part of the upcoming 0.3 release.

Regards,

Marc Worrell

Reply all
Reply to author
Forward
0 new messages