This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from OpenSSL import crypto | |
| from socket import gethostname | |
| k = crypto.PKey() | |
| k.generate_key(crypto.TYPE_RSA, 2048) # generate RSA key-pair | |
| cert = crypto.X509() | |
| cert.get_subject().C = "<country>" | |
| cert.get_subject().ST = "<city>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import asyncio | |
| import re | |
| import asyncio_redis | |
| import tornado.concurrent | |
| import tornado.httpclient | |
| import tornado.web | |
| import tornado.platform.asyncio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tornado | |
| class RequestContextHandler(tornado.web.RequestHandler): | |
| def _execute(self, transforms, *args, **kwargs): | |
| # following the example of: | |
| # https://github.com/bdarnell/tornado_tracing/blob/master/tornado_tracing/recording.py | |
| global_data = {} # add whatever here, e.g. self.request |