[wp-hackers] WordPress and Websockets

Dagan Henderson Dagan.Henderson at epyllion.com
Thu Sep 22 17:00:10 UTC 2011

Unfortunately, I think the handicap here is (and will be for quite some time) hosting services. I'd love to be able to run something like socket.io, but until hosting services catch up, I don't think we'll see much, if any, websocket use in the WordPress core.

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Braydon
Sent: Wednesday, September 21, 2011 10:20 PM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] WordPress and Websockets

They were doing reverse ajax, "comet", a couple years ago, by holding an xhr open for a long time without needing websockets. You would still need to have a long running PHP process running....

This seems like something better done in another language, if maintaining WordPress interface, you could write something just for the front-end entirely in Node.js? I'm really curious to do something in this area.

On 09/20/2011 02:21 PM, Eric Mann wrote:
> I've bounced this idea on the WordPress StackExchange, in the support 
> forums, and informally to a few other developers via Twitter and 
> in-person at WordCamp Portland.  I have yet to hear a solid answer, 
> though ... so I wanted to bounce it by here, too.
> I'm working on a plugin that, ideally, would make use of websockets to 
> communicate between the front-end and the WordPress backend.  
> Basically, whenever a post is published on the backend, it should 
> trigger an event on the front-end for other users.  This can be done 
> using old school AJAX and long polling, but the point is more to make 
> use of the cutting-edge technology than to fall back on "what works."
> Unfortunately, most users are running WordPress on an Apache server 
> ... and Apache doesn't natively support websockets.  There are some 
> modules you can add to make it work, but that's not an option for 
> people running WP on a shared host.
> One option I have is to use Apache anyway.  It can be forced to work 
> with websockets using a few PHP scripts I found, but once the 
> websocket is open you essentially steal a persistent connection to 
> Apache (which is itself a blocking process).  So while this would 
> work, and would probably work well for low-traffic sites, it could 
> easily lock up an ill-configured server or crash someones system.
> Another option is to host the websocket part of the system on my 
> server (where I can use Nginix, Node.js, or any other 
> websocket-friendly server) and have the plugin interface with my 
> server.  The downside here is that my system then becomes the bottleneck ...
> My question to you: which option would you take?  Try to make due with 
> installed software, or move the mission-critical part of the 
> application to your own box?  Does anyone have experience implementing 
> websockets in WordPress already?  Is there something I'm missing?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> !DSPAM:4e7903c65591418750826!

wp-hackers mailing list
wp-hackers at lists.automattic.com

More information about the wp-hackers mailing list