def make_server(application, conf_dir=None):
"""
Configure the server return the server instance
"""
if conf_dir:
load_config(conf_dir)
configure_syslog()
log_config()
if options.use_ssl:
ssl_options = ssl_server_options()
server = tornado.httpserver.HTTPServer(
application, ssl_options=ssl_options)
general_logger.info(
'start tornado https server at https://%s:%s'
' with ssl_options: %s', options.ip, options.port, ssl_options)
else:
server = tornado.httpserver.HTTPServer(application)
general_logger.info('start tornado http server at http://{0}:{1}'.format(
options.ip, options.port))
server.bind(options.port, options.ip)
return server
评论列表
文章目录