예제 #1
0
def run(args=None):
    """
    Start a blocking `ngrok` process with the default binary and the system's command line args.

    :param args: Arguments to be passed to the `ngrok` process.
    :type args: list, optional
    """
    if args is None:
        args = []

    ensure_ngrok_installed(DEFAULT_NGROK_PATH)

    process.run_process(DEFAULT_NGROK_PATH, args)
예제 #2
0
def run(args=None):
    """
    Start a blocking :code:`ngrok` process with the default binary and the passed args.

    :param args: Arguments to be passed to the :code:`ngrok` process.
    :type args: list[str], optional
    """
    if args is None:
        args = []

    ensure_ngrok_installed(conf.DEFAULT_NGROK_PATH)

    process.run_process(conf.DEFAULT_NGROK_PATH, args)
예제 #3
0
def run(args=None):
    """
    Ensure ``ngrok`` is installed in the default location, then call :func:`~pyngrok.process.run_process`.

    This method is meant for interacting with ``ngrok`` from the command line and is not necessarily
    compatible with non-blocking API methods. For that, use :mod:`~pyngrok.ngrok`'s interface methods (like
    :func:`~pyngrok.ngrok.connect`), or use :func:`~pyngrok.process.get_process`.

    :param args: Arguments to be passed to the ``ngrok`` process.
    :type args: list[str], optional
    """
    if args is None:
        args = []

    ensure_ngrok_installed(conf.DEFAULT_NGROK_PATH)

    process.run_process(conf.DEFAULT_NGROK_PATH, args)
예제 #4
0
def run(args=None, pyngrok_config=None):
    """
    Ensure ``ngrok`` is installed at the default path, then call :func:`~pyngrok.process.run_process`.

    This method is meant for interacting with ``ngrok`` from the command line and is not necessarily
    compatible with non-blocking API methods. For that, use :mod:`~pyngrok.ngrok`'s interface methods (like
    :func:`~pyngrok.ngrok.connect`), or use :func:`~pyngrok.process.get_process`.

    :param args: Arguments to be passed to the ``ngrok`` process.
    :type args: list[str], optional
    :param pyngrok_config: A ``pyngrok`` configuration to use when interacting with the ``ngrok`` binary,
        overriding :func:`~pyngrok.conf.get_default()`.
    :type pyngrok_config: PyngrokConfig, optional
    """
    if args is None:
        args = []
    if pyngrok_config is None:
        pyngrok_config = conf.get_default()

    install_ngrok(pyngrok_config)

    process.run_process(pyngrok_config.ngrok_path, args)