Python cherrypy.wsgiserver.CherryPyWSGIServer() Examples
The following are 30
code examples of cherrypy.wsgiserver.CherryPyWSGIServer().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
cherrypy.wsgiserver
, or try the search function
.
Example #1
Source File: bottle.py From malwareHunter with GNU General Public License v2.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #2
Source File: bottle.py From aws-mock-metadata with MIT License | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #3
Source File: bottle.py From EasY_HaCk with Apache License 2.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #4
Source File: bottle.py From nlgserv with MIT License | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #5
Source File: bottle.py From bazarr with GNU General Public License v3.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #6
Source File: bottle.py From POC-EXP with GNU General Public License v3.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #7
Source File: bottle.py From warriorframework with Apache License 2.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #8
Source File: bottle.py From warriorframework with Apache License 2.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #9
Source File: REST.py From im with GNU General Public License v3.0 | 6 votes |
def run(self, handler): try: # First try to use the new version from cheroot.ssl.pyopenssl import pyOpenSSLAdapter from cheroot import wsgi server = wsgi.Server((self.host, self.port), handler, request_queue_size=32) except Exception: from cherrypy.wsgiserver.ssl_pyopenssl import pyOpenSSLAdapter from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler, request_queue_size=32) self.srv = server # If cert variable is has a valid path, SSL will be used # You can set it to None to disable SSL server.ssl_adapter = pyOpenSSLAdapter(Config.REST_SSL_CERTFILE, Config.REST_SSL_KEYFILE, Config.REST_SSL_CA_CERTS) try: server.start() finally: server.stop()
Example #10
Source File: bottle.py From malwareHunter with GNU General Public License v2.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #11
Source File: __init__.py From ob2 with BSD 2-Clause "Simplified" License | 6 votes |
def main(): server_type = "werkzeug" if not config.debug_mode: server_type = "cherrypy" if config.web_server_type: server_type = config.web_server_type assert server_type in ("werkzeug", "cherrypy"), "Only werkzeug and cherrypy supported" if server_type == "werkzeug": assert config.debug_mode, "Refusing to use werkzeug outside of debug mode" app.run(config.web_host, config.web_port, debug=True, use_reloader=False, use_debugger=True, threaded=True) elif server_type == "cherrypy": dispatcher = wsgiserver.WSGIPathInfoDispatcher({"/": app}) web_server = wsgiserver.CherryPyWSGIServer((config.web_host, config.web_port), dispatcher, server_name=config.web_public_host) web_server.start()
Example #12
Source File: __init__.py From arnold-usd with Apache License 2.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #13
Source File: bottle.py From aws-servicebroker with Apache License 2.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #14
Source File: bottle.py From appengine-bottle-skeleton with Apache License 2.0 | 6 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver self.options['bind_addr'] = (self.host, self.port) self.options['wsgi_app'] = handler certfile = self.options.get('certfile') if certfile: del self.options['certfile'] keyfile = self.options.get('keyfile') if keyfile: del self.options['keyfile'] server = wsgiserver.CherryPyWSGIServer(**self.options) if certfile: server.ssl_certificate = certfile if keyfile: server.ssl_private_key = keyfile try: server.start() finally: server.stop()
Example #15
Source File: server.py From squadron with MIT License | 5 votes |
def get_server(address, port, application): def _serve(server): server.start() server = wsgiserver.CherryPyWSGIServer((address, int(port)), application) t = threading.Thread(target=_serve, args=(server,)) t.daemon = True return (t, server)
Example #16
Source File: REST.py From im with GNU General Public License v3.0 | 5 votes |
def run(self, handler): try: # First try to use the new version from cheroot import wsgi server = wsgi.Server((self.host, self.port), handler, request_queue_size=32) except Exception: from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler, request_queue_size=32) self.srv = server try: server.start() finally: server.stop()
Example #17
Source File: _cpwsgi_server.py From moviegrabber with GNU General Public License v3.0 | 5 votes |
def __init__(self, server_adapter=cherrypy.server): self.server_adapter = server_adapter self.max_request_header_size = self.server_adapter.max_request_header_size or 0 self.max_request_body_size = self.server_adapter.max_request_body_size or 0 server_name = (self.server_adapter.socket_host or self.server_adapter.socket_file or None) self.wsgi_version = self.server_adapter.wsgi_version s = wsgiserver.CherryPyWSGIServer s.__init__(self, server_adapter.bind_addr, cherrypy.tree, self.server_adapter.thread_pool, server_name, max = self.server_adapter.thread_pool_max, request_queue_size = self.server_adapter.socket_queue_size, timeout = self.server_adapter.socket_timeout, shutdown_timeout = self.server_adapter.shutdown_timeout, ) self.protocol = self.server_adapter.protocol_version self.nodelay = self.server_adapter.nodelay if sys.version_info >= (3, 0): ssl_module = self.server_adapter.ssl_module or 'builtin' else: ssl_module = self.server_adapter.ssl_module or 'pyopenssl' if self.server_adapter.ssl_context: adapter_class = wsgiserver.get_ssl_adapter_class(ssl_module) self.ssl_adapter = adapter_class( self.server_adapter.ssl_certificate, self.server_adapter.ssl_private_key, self.server_adapter.ssl_certificate_chain) self.ssl_adapter.context = self.server_adapter.ssl_context elif self.server_adapter.ssl_certificate: adapter_class = wsgiserver.get_ssl_adapter_class(ssl_module) self.ssl_adapter = adapter_class( self.server_adapter.ssl_certificate, self.server_adapter.ssl_private_key, self.server_adapter.ssl_certificate_chain) self.stats['Enabled'] = getattr(self.server_adapter, 'statistics', False)
Example #18
Source File: bottle.py From props with MIT License | 5 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) server.start()
Example #19
Source File: bottle.py From props with MIT License | 5 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) server.start()
Example #20
Source File: anyserver.py From termite-visualizations with BSD 3-Clause "New" or "Revised" License | 5 votes |
def rocket_with_repoze_profiler(app, address, **options): from gluon.rocket import CherryPyWSGIServer from repoze.profile.profiler import AccumulatingProfileMiddleware from gluon.settings import global_settings global_settings.web2py_crontype = 'none' wrapped = AccumulatingProfileMiddleware( app, log_filename='wsgi.prof', discard_first_request=True, flush_at_shutdown=True, path='/__profile__' ) server = CherryPyWSGIServer(address, wrapped) server.start()
Example #21
Source File: anyserver.py From termite-visualizations with BSD 3-Clause "New" or "Revised" License | 5 votes |
def rocket(app, address, **options): from gluon.rocket import CherryPyWSGIServer server = CherryPyWSGIServer(address, app) server.start()
Example #22
Source File: anyserver.py From termite-visualizations with BSD 3-Clause "New" or "Revised" License | 5 votes |
def cherrypy(app, address, **options): from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer(address, app) server.start()
Example #23
Source File: bottle.py From SalesforceXyTools with Apache License 2.0 | 5 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) try: server.start() finally: server.stop()
Example #24
Source File: bottle.py From VaspCZ with MIT License | 5 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) try: server.start() finally: server.stop()
Example #25
Source File: bottle.py From lokun-record with GNU Affero General Public License v3.0 | 5 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) try: server.start() finally: server.stop()
Example #26
Source File: bottle.py From annotated-py-projects with MIT License | 5 votes |
def run(self, handler): from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) server.start()
Example #27
Source File: bottle.py From NoobSec-Toolkit with GNU General Public License v2.0 | 5 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) try: server.start() finally: server.stop()
Example #28
Source File: bottle.py From contrail-server-manager with Apache License 2.0 | 5 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) try: server.start() finally: server.stop()
Example #29
Source File: bottle.py From annotated-py-bottle with MIT License | 5 votes |
def run(self, handler): from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) server.start()
Example #30
Source File: bottle2.py From pyFileFixity with MIT License | 5 votes |
def run(self, handler): # pragma: no cover from cherrypy import wsgiserver server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) server.start()