Loading .ssh/forward.py +13 −6 Original line number Diff line number Diff line Loading @@ -98,8 +98,8 @@ class Stream: wlist.append(whandle) def main(): sock_stream = Stream.open_socket(*sys.argv[1:3]) def socket_pipe(host, port): sock_stream = Stream.open_socket(host, port) pipe_stream = Stream.open_stdpipe() sock_stream.connect_stream(pipe_stream) Loading @@ -116,10 +116,17 @@ def main(): break rlist, wlist, _ = select.select(rlist, wlist, xlist, None) if __name__ == '__main__': def main(): host, port = sys.argv[1:3] try: main() socket_pipe(host, port) except IOError as exc: sys.stderr.write("Connection failed: %s\n" % str(exc)) sys.stderr.write( "Connect to {}:{} failed: {}\n" .format(host, port, str(exc)) ) sys.exit(1) if __name__ == '__main__': main() Loading
.ssh/forward.py +13 −6 Original line number Diff line number Diff line Loading @@ -98,8 +98,8 @@ class Stream: wlist.append(whandle) def main(): sock_stream = Stream.open_socket(*sys.argv[1:3]) def socket_pipe(host, port): sock_stream = Stream.open_socket(host, port) pipe_stream = Stream.open_stdpipe() sock_stream.connect_stream(pipe_stream) Loading @@ -116,10 +116,17 @@ def main(): break rlist, wlist, _ = select.select(rlist, wlist, xlist, None) if __name__ == '__main__': def main(): host, port = sys.argv[1:3] try: main() socket_pipe(host, port) except IOError as exc: sys.stderr.write("Connection failed: %s\n" % str(exc)) sys.stderr.write( "Connect to {}:{} failed: {}\n" .format(host, port, str(exc)) ) sys.exit(1) if __name__ == '__main__': main()