r"""
    simple webserver that echos its arguments

    Args:
        domain (None): (default = None)
        port (int): (default = 5832)

    CommandLine:
        python -m utool.util_web --exec-start_simple_webserver:0
        python -m utool.util_web --exec-start_simple_webserver:1

    Example:
        >>> # DISABLE_DOCTEST
        >>> from utool.util_web import *  # NOQA
        >>> domain = None
        >>> port = 5832
        >>> result = start_simple_webserver(domain, port)
        >>> print(result)

def start_simple_webserver(domain=None, port=5832):
    r"""
    simple webserver that echos its arguments

    Args:
        domain (None): (default = None)
        port (int): (default = 5832)

    CommandLine:
        python -m utool.util_web --exec-start_simple_webserver:0
        python -m utool.util_web --exec-start_simple_webserver:1

    Example:
        >>> # DISABLE_DOCTEST
        >>> from utool.util_web import *  # NOQA
        >>> domain = None
        >>> port = 5832
        >>> result = start_simple_webserver(domain, port)
        >>> print(result)
    """
    import tornado.ioloop
    import tornado.web
    import tornado.httpserver
    import tornado.wsgi
    import flask
    app = flask.Flask('__simple__')
    @app.route('/', methods=['GET', 'POST', 'DELETE', 'PUT'])
    def echo_args(*args, **kwargs):
        from flask import request
        print('Simple server was pinged')
        print('args = %r' % (args,))
        print('kwargs = %r' % (kwargs,))
        print('request.args = %r' % (request.args,))
        print('request.form = %r' % (request.form,))
        return ''
    if domain is None:
        domain = get_localhost()
    app.server_domain = domain
    app.server_port = port
    app.server_url = 'http://%s:%s' % (app.server_domain, app.server_port)
    print('app.server_url = %s' % (app.server_url,))
    http_server = tornado.httpserver.HTTPServer(
        tornado.wsgi.WSGIContainer(app))
    http_server.listen(app.server_port)
    tornado.ioloop.IOLoop.instance().start()