note: this was built for spdy/2, and I've since abandoned the project.
python-spdy is a simple spdy parser/(de)muxer for python >= 2.7 (including 3.x).
importspdy, spdy.frames#with an existing socket or somethingcontext=spdy.Context(side=spdy.SERVER, version=2)
whileTrue:
data=sock.recv(1024)
ifnotdata:
breakcontext.incoming(data)
whileTrue:
frame=context.get_frame()
ifnotframe: breakifisinstance(frame, spdy.frames.Ping):
pong=spdy.frames.Ping(frame.ping_id)
context.put_frame(pong)
outgoing=context.outgoing()
ifoutgoing:
sock.sendall(outgoing) requires:
pip install cython bitarray
then:
python setup.py install