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
57af995f
Commit
57af995f
authored
Feb 25, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.rst
parent
911ffb24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
README.rst
README.rst
+3
-5
No files found.
README.rst
View file @
57af995f
...
@@ -959,30 +959,28 @@ BaseRequestHandler usage:
...
@@ -959,30 +959,28 @@ BaseRequestHandler usage:
#!/usr/bin/env python
#!/usr/bin/env python
import io, ssl
import io, ssl
from pprint import pprint
import nghttp2
import nghttp2
class Handler(nghttp2.BaseRequestHandler):
class Handler(nghttp2.BaseRequestHandler):
def on_headers(self):
def on_headers(self):
self.push(path='/css/bootstrap.css',
self.push(path='/css/bootstrap.css',
request_headers = [(
b'content-length', b
'3')],
request_headers = [(
'content-length',
'3')],
status=200,
status=200,
body='foo')
body='foo')
self.push(path='/js/bootstrap.js',
self.push(path='/js/bootstrap.js',
method='GET',
method='GET',
request_headers = [(
b'content-length', b
'10')],
request_headers = [(
'content-length',
'10')],
status=200,
status=200,
body='foobarbuzz')
body='foobarbuzz')
self.send_response(status=200,
self.send_response(status=200,
headers = [(
b'content-type', b
'text/plain')],
headers = [(
'content-type',
'text/plain')],
body=io.BytesIO(b'nghttp2-python FTW'))
body=io.BytesIO(b'nghttp2-python FTW'))
ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
ctx.options = ssl.OP_ALL | ssl.OP_NO_SSLv2
ctx.options = ssl.OP_ALL | ssl.OP_NO_SSLv2
ctx.set_npn_protocols(['h2-10'])
ctx.load_cert_chain('server.crt', 'server.key')
ctx.load_cert_chain('server.crt', 'server.key')
# give None to ssl to make the server non-SSL/TLS
# give None to ssl to make the server non-SSL/TLS
...
...
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