Cherrypy 3.2.0:启动引擎在同一实例中同时运行HTTP和HTTPS
早上好 我在HTTP或HTTPS中成功启动了cherrypy 3.2.0引擎:Cherrypy 3.2.0:启动引擎在同一实例中同时运行HTTP和HTTPS,http,python-3.x,https,cherrypy,Http,Python 3.x,Https,Cherrypy,早上好 我在HTTP或HTTPS中成功启动了cherrypy 3.2.0引擎: # ssl variable commes input parameters. Bellow cherrypy configuration is fully configured if ssl: print('Setting up SSL') cherrypy.server.ssl_certificate = "conf/private/" + platform.node() + ".crt"
# ssl variable commes input parameters. Bellow cherrypy configuration is fully configured
if ssl:
print('Setting up SSL')
cherrypy.server.ssl_certificate = "conf/private/" + platform.node() + ".crt"
cherrypy.server.ssl_private_key = "conf/private/" + platform.node() + ".key"
'''
----------------------------------
Start server instance
----------------------------------
'''
if hasattr(cherrypy.engine, 'block'):
# 3.1 syntax
cherrypy.engine.start()
cherrypy.engine.block()
else:
# 3.0 syntax
cherrypy.server.quickstart(cherrypy.root, config=py_app_conf)
cherrypy.engine.start()
那么,是否可以将cherrypy配置为在同一个cherrypy服务器中以http和https启动
感谢ypur回复。您需要在不同的端口上有两台服务器:。还有一个多服务器配置功能似乎没有文档记录,请查看它是否适用于您,请参阅
\u cpconfig.py
修复链接中的\u server\u namespace\u handler()
函数:@EricSmith它现在可能已经过时,但我最初建议的内容现在已记录在中。