Assuming you have Python installed on your system:
pip install twisted
pip install pyOpenSSL
pip install service_identity
import logging | |
import fcntl | |
from contextlib import contextmanager | |
@contextmanager | |
def locked_open(filename, mode='r'): | |
"""locked_open(filename, mode='r') -> <open file object> | |
Context manager that on entry opens the path `filename`, using `mode` | |
(default: `r`), and applies an advisory write lock on the file which |
import base64 | |
import json | |
import logging | |
import os | |
import sys | |
from abc import ABC | |
import jwt | |
import tornado.escape | |
import tornado.httpserver |
class MediaRequestHandler: public Poco::Net::HTTPRequestHandler | |
{ | |
public: | |
enum | |
{ | |
BUFFER_SIZE = 8192 | |
}; | |
MediaRequestHandler(const std::string& mediaPath): | |
_mediaPath(mediaPath) |