

def star_forward(cluster, logdir, cmdline, *args):
    'Try to setup reverse tunnel back to here'
    global forwarding_dest
    if (len(args) == 1):
        forwarding_dest = (args[0], 80)
    elif (len(args) > 1):
        forwarding_dest = (cluster[0], int(args[1]))
    print('Setting up remote port forwards to', forwarding_dest)
    for (host, t) in cluster.connections.items():
        try:
            if (host not in cluster.reverse_port):
                listener = t.request_port_forward('127.0.0.1', 0, forwarding)
                if listener:
                    cluster.reverse_port[host] = listener
                else:
                    print(('Remote host %s denied port-forward request' % host))
        except Exception as e:
            print(e)

dataset/ETHPy150Open radssh/radssh/radssh/star_commands.py star_forward/VarMisuse@61/87 `args`->`cluster`