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?
Run an existing spdy server such as:
https://github.com/indutny/node-spdy
It would seem that the quickest and easiest way would be to follow the instructions located here.
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()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With