15

I just finished skimming the SPDY white paper and now I'm interested in trying it out. I understand that Google is serving content over SSL to Chrome using SPDY.

What's the easiest way to set up and serve a basic "Hello world" HTML page over SPDY?

Connor
  • 60,945
  • 26
  • 140
  • 138
Marcel
  • 27,280
  • 9
  • 67
  • 84

4 Answers4

3

Run an existing spdy server such as:

https://github.com/indutny/node-spdy

Mark
  • 28,819
  • 33
  • 102
  • 136
2

It would seem that the quickest and easiest way would be to follow the instructions located here.

Iiridayn
  • 1,590
  • 19
  • 39
1

I wrote spdylay SPDY library in C and recently added Python wrapper python-spdylay. It needs Python 3.3.0 (which is RC1 at the time of this writing), but you can write simple SPDY server just like this:

#!/usr/bin/env python
import spdylay

# private key file
KEY_FILE='server.key'
# certificate file
CERT_FILE='server.crt'

class MySPDYRequestHandler(spdylay.BaseSPDYRequestHandler):

    def do_GET(self):
        self.send_response(200)
        self.send_header('content-type', 'text/html; charset=UTF-8')

        content = '''\
<html><head><title>SPDY</title></head><body><h1>Hello World</h1>
</body></html>'''.encode('UTF-8')

        self.wfile.write(content)

if __name__ == "__main__":
    HOST, PORT = "localhost", 3000

    server = spdylay.ThreadedSPDYServer((HOST, PORT),
                                        MySPDYRequestHandler,
                                        cert_file=CERT_FILE,
                                        key_file=KEY_FILE)
    server.start()
0

The intention of SPDY is that it is entirely transparent to your webapplication. You don't need to write code to use SPDY, you just need to use a webserver that supports it.

If you have a java web application, then you can SPDY enable it by using Jetty. 3 simple steps: add a jar to the boot path to enable NPN, create an SSL certificate for your server, configure SPDY as the connector type. See http://wiki.eclipse.org/Jetty/Feature/SPDY

This will be even easier in Jetty-9

gregw
  • 2,264
  • 18
  • 20