Beispiel #1
0
def make_server():
    """Create the Mailman REST server.

    Use this if you just want to run Mailman's wsgiref-based REST server.
    """
    host = config.webservice.hostname
    port = int(config.webservice.port)
    server = wsgi_server(host, port, make_application(), handler_class=AdminWebServiceWSGIRequestHandler)
    return server
Beispiel #2
0
def make_server():
    """Create the Mailman REST server.

    Use this if you just want to run Mailman's wsgiref-based REST server.
    """
    host = config.webservice.hostname
    port = int(config.webservice.port)
    server = wsgi_server(
        host, port, make_application(),
        server_class=AdminWSGIServer,
        handler_class=AdminWebServiceWSGIRequestHandler)
    return server
Beispiel #3
0
def make_server(
        host: str,
        port: int,
        application: typing.Callable,
        threading: typing.Optional[bool] = False,
        multiprocessing: typing.Optional[bool] = False,
        wsgiref: typing.Optional[bool] = False
) -> typing.Any:  # pragma: no cover
    """
    Create a new WSGI listening on host and port,
    accepting connections for application.
    You may create either SimpleHTTPServer or
    Threading or Multiprocessing HTTPServer.
    """
    if wsgiref:
        from wsgiref.simple_server import make_server as wsgi_server
    else:
        wsgi_server = WSGIServer

    return wsgi_server(host, port, application, threading, multiprocessing)