Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/colinmarc/python-spdy
a spdy parsing library for python
https://github.com/colinmarc/python-spdy
Last synced: 24 days ago
JSON representation
a spdy parsing library for python
- Host: GitHub
- URL: https://github.com/colinmarc/python-spdy
- Owner: colinmarc
- License: bsd-2-clause
- Created: 2012-03-21T05:14:21.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-04T18:09:25.000Z (over 10 years ago)
- Last Synced: 2024-04-14T09:09:53.555Z (7 months ago)
- Language: Python
- Homepage:
- Size: 174 KB
- Stars: 34
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
python-spdy
==========**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).
usage
-----
```pythonimport spdy, spdy.frames
#with an existing socket or something
context = spdy.Context(side=spdy.SERVER, version=2)while True:
data = sock.recv(1024)
if not data:
breakcontext.incoming(data)
while True:
frame = context.get_frame()
if not frame:
break
if isinstance(frame, spdy.frames.Ping):
pong = spdy.frames.Ping(frame.ping_id)
context.put_frame(pong)outgoing = context.outgoing()
if outgoing:
sock.sendall(outgoing)
```
installation
------------requires:
pip install cython bitarray
then:
python setup.py install