def __init__(self, handler_class, path, keyfile=None, certfile=None):
"""Initialize new UnixSocketHTTPEndpoint object
Args:
handler_class (obj): a request handler class that will be handling
requests received by internal httpd server
path (str): Unix socket path, that internal httpd server will listen
on
"""
if certfile is not None and keyfile is not None:
endpoint_id = "https://{}".format(path)
else:
endpoint_id = "http://{}".format(path)
super().__init__(endpoint_id)
self._context.data['socket_path'] = path
self._context.data['certfile'] = certfile
self._context.data['keyfile'] = keyfile
self._handler_class = handler_class
self.__cleanup_stale_socket(path)
self.__setup_httpd_thread(path)
评论列表
文章目录