Friday, June 24, 2011

SPDY in Non-SPDY Browsers

‹prev | My Chain | next›

I need to focus on writing SPDY Book for the rest of the month. To keep my chain alive, I will pick up some necessary, but hopefully low-hanging fruit. Up today, ensuring that express-spdy still works with browsers that are not SPDY-enabled.

Firing up Firefox, I observe a perfectly normal HTTPS session in Wireshark:



Nice. Looking at Wireshark output against the same site, but using Chrome, I get a normal SPDY session, as evidenced by the highlighted SYN_REPLY (octet #4 is 0x02):



If I switch the Next Protocol Negotiation (NPN) in my sample app's configuration to http/1.1 only:
var app = module.exports = express.createServer({
key: fs.readFileSync(__dirname + '/keys/spdy-key.pem'),
cert: fs.readFileSync(__dirname + '/keys/spdy-cert.pem'),
ca: fs.readFileSync(__dirname + '/keys/spdy-csr.pem'),
NPNProtocols: ['http/1.1']
});
When I access the site in Chrome, I also observe a perfectly normal HTTPS sessions in Wireshark:



Cool. I still cannot quite believe that this stuff just works.

Last up tonight, I add a few more pages to my sample site. After clicking around the site some, I check my Wireshark output again:



Again, nice. The site works just like a normal site should, but it was all done in the same SPDY session. The last request resulted in a data frame over stream 0x1b—the 27th stream as I have been clicking around my sample site.

Cool beans. This really seems to be working. Up tomorrow, I will see if I can get SPDY server push working in express-spdy. I think that ought to be low hanging fruit as well...


Day #58

No comments:

Post a Comment