Saturday, April 14, 2012

Ubuntu 12.04 Loves Express-Spdy

I now have express-spdy working with node.js—both the stable 0.6.x release and, as of last night, the unstable 0.7.x series. For both stable and unstable, I have a working express-spdy generator capable of generating and spinning up a SPDY server. The SPDY server has all of the goodness express.js but with working SPDY server push and other SPDY goodness.

My goal for the next couple of weeks is to get the unstable version working with the latest versions of node-spdy (express-spdy currently pegs to last year's version). Last year, I was able to keep things working against node.js unstable with crazy packages with which I polluted npm. This year, I found that I can develop this all on GitHub, provided that I use unstable branches for each of my express.js fork, my connect.js fork, express-spdy, and connect-spdy. Each of those unstable branches has a package.json that lists the other unstable forks as dependencies:

It is all one, big, happy, very unstable family. But it should be good enough to let me do what I need to do.

But, before moving on, I hope to remove another section from the install instructions for express-spdy. Specifically, installing edge-openssl is a pain. I recently upgraded to Ubuntu 12.04, which is rumored to include a version of openssl that supports NPN (next protocol generation). NPN is how SPDY clients are able to identify servers capable of speaking SPDY. Without it, SPDY will not work.

The current version of node that I have installed is SPDY capable by virtue of linking to the edge-openssl that I have installed locally:

After installing the system linked node.js, I npm install express-spdy globally (to get the executable generator), run the generator to build a sample server, install the packages necessary for the server, and fire up the server: