Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
cc15f4bd
Commit
cc15f4bd
authored
Aug 25, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python: add MANIFEST.in and README.rst
parent
ade401c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
0 deletions
+85
-0
python/MANIFEST.in
python/MANIFEST.in
+1
-0
python/README.rst
python/README.rst
+84
-0
No files found.
python/MANIFEST.in
0 → 100644
View file @
cc15f4bd
include spdylay.pyx cspdylay.pxd spdylay_tests.py spdyclient.py spdyserv.py README.rst
python/README.rst
0 → 100644
View file @
cc15f4bd
Python-spdylay is a Python SPDY library on top of Spdylay C
library. It supports SPDY/2 and SPDY/3 protocol.
It does not perform any I/O operations. When the library needs them,
it calls the callback functions provided by the application. It also
does not include any event polling mechanism, so the application can
freely choose the way of handling events.
It provides almost all API Spdylay provides with Pythonic fashion.
The core library API works with Python 2 and 3. But
``ThreadedSPDYServer`` requires Python 3.3 because it uses TLS NPN
extension.
Installation
============
First install Spdylay library. You can grab a source distribution from
`sf.net download page
<http:
//
sourceforge
.
net
/
projects
/
spdylay
/
files
/
stable
/>
`_
or `clone git repository
<https:
//
github
.
com
/
tatsuhiro-t
/
spdylay
>
`_.
See `Spdylay documentation
<http:
//
spdylay
.
sourceforge
.
net
/
package_README
.
html
>
`_ for the
required packages and how to build Spdylay from git repository.
After Spdylay is installed, run ``build_ext`` command to build
extension module::
$ python setup.py build_ext
If you installed Spdylay library in other than standard location, use
``--include-dirs`` and ``--library-dirs`` to specify header file and
library locations respectively.
Documentation
=============
See `python-spdylay documentation
<http:
//
spdylay
.
sourceforge
.
net
/
python
.
html
>
`_.
Samples
=======
Here is a simple SPDY server::
#!/usr/bin/env python
# The example SPDY server. Python 3.3 or later is required because TLS
# NPN is used in spdylay.ThreadedSPDYServer. Put private key and
# certificate file in the current working directory.
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 FTW
</title></head>
<body>
<h1>
SPDY FTW
</h1>
<p>
The age of HTTP/1.1 is over. The time of SPDY has come.
</p>
</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()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment