def run(httpd):
    """ Run Lambda Gateway server.

        :param object httpd: ThreadingHTTPServer instance
    """
    host, port = httpd.socket.getsockname()[:2]
    url_host = f'[{host}]' if ':' in host else host
    print(f'Serving HTTP on {host} port {port} (http://{url_host}:{port}/) ...'
        )
    try:
        httpd.serve_forever()
    except KeyboardInterrupt:
        print('\nKeyboard interrupt received, exiting.')
    finally:
        httpd.shutdown()
