PHP archive
Event Streaming in Web Browsers
2006-09-01 17:29
Yeah, I’m going to talk about Opera 9 again, and about “secret” features. Since Opera 9, we’ve had support for Server-Sent Events from the Web Applications 1.0 spec. Quoting the entry we just published in the Opera Web Applications blog
One cool feature we added to Opera 9 is Server-Sent Events from the WHATWG Web Applications 1.0 specification. Using SSE you can push DOM events continously from your web server to the visitor’s browser. This creates a lot of exciting opportunities for web application authors.
As an approach for building Ajax applications wanting near realtime data from the server, this approach is superior: No ugly hacks in the client-side code, just DOM events. After having added an <event-source> element to your markup, you simply set up an event listener on the element:
document.getElementsByTagName("event-source")[0]
.addEventListener("server-time", eventHandler, false);
function eventHandler(event)
{
// Alert time sent by the server
alert(event.data);
}
Easy, simple and clean. Which is the same on the server. We have built a neat little demo IRC-like chat client that is open for testing. The server is built on Twisted, an event-driven networking framework written in Python. During initial testing we tried to put the server through pure, unadulterated load abuse, but were unable to bring it down, which says something about the advantages for this approach on the server as well.
What applications do you see becoming a reality with SSE?
Randompassword: Pronouncable passwords
2005-05-20 14:02
Link: Randompassword: Pronouncable passwords
Randompassword is a PHP password generator that generates passwords that are both relatively secure, and pronouncable.
Referer tarpit
2005-03-05 10:14
Let it be no secret that referer spammers annoy me. Let it be no secret that I don’t think they are the brightest crowd around, either.
Which is why I’m actively fighting them. Meet Referer Tarpit.
Setting up PHP 5 on Dreamhost
2005-02-28 09:46
Link: Setting up PHP 5 on Dreamhost
If you need PHP5, DreamHost will allow you to compile and install your own version of PHP (running as CGI). This is a short and simple howto for setting up PHP5 on your DreamHost account.
Update: This should no longer be neccessary: There is now a configuration option in the Dreamhost web panel to enable PHP5.