def run_proxy_in_background(ctx: click.Context, opts: ProxyContext, connection_data: RemoteAccessConnectionData, ready_signal: threading.Event=None):
    'Run the proxy in a background thread\n\n    Args:\n        ctx (click.Context): Click context\n        opts (ProxyContext): Proxy options\n        connection_data (RemoteAccessConnectionData): Remote access connection data\n    '
    stop_signal = threading.Event()
    _local_ready_signal = threading.Event()
    register_signals()
    background = threading.Thread(target=start_proxy, args=(ctx, opts), kwargs=dict(connection_data=connection_data, stop_signal=stop_signal, ready_signal=_local_ready_signal), daemon=True)
    background.start()
    if (not _local_ready_signal.wait(opts.wait_port_timeout)):
        opts.exit_server_not_ready()
    opts.set_env()
    timer = CommandTimer('Duration', on_exit=click.echo).start()

    @ctx.call_on_close
    def _shutdown_server_thread():
        stop_signal.set()
        background.join()
        timer.stop_with_message()
    if ready_signal:
        ready_signal.set()
Run the proxy in a background thread

Args:
    ctx (click.Context): Click context
    opts (ProxyContext): Proxy options
    connection_data (RemoteAccessConnectionData): Remote access connection data
def run_proxy_in_background(ctx: click.Context, opts: ProxyContext, connection_data: RemoteAccessConnectionData, ready_signal: threading.Event=None):
    'Run the proxy in a background thread\n\n    Args:\n        ctx (click.Context): Click context\n        opts (ProxyContext): Proxy options\n        connection_data (RemoteAccessConnectionData): Remote access connection data\n    '
    stop_signal = threading.Event()
    _local_ready_signal = threading.Event()
    register_signals()
    background = threading.Thread(target=start_proxy, args=(ctx, opts), kwargs=dict(connection_data=connection_data, stop_signal=stop_signal, ready_signal=_local_ready_signal), daemon=True)
    background.start()
    if (not _local_ready_signal.wait(opts.wait_port_timeout)):
        opts.exit_server_not_ready()
    opts.set_env()
    timer = CommandTimer('Duration', on_exit=click.echo).start()

    @ctx.call_on_close
    def _shutdown_server_thread():
        stop_signal.set()
        background.join()
        timer.stop_with_message()
    if ready_signal:
        ready_signal.set()