summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2007-02-12 10:30:21 -0800
committerRobey Pointer <robey@lag.net>2007-02-12 10:30:21 -0800
commitb9f43f3f06da2868a7f19eef8ab2b8080bdb6a1c (patch)
tree6e1ff62244b20419c82a822b6305680de425419c
parentab2e5a710e18f6de3033b82f437840529db862ca (diff)
[project @ robey@lag.net-20070212183021-0c9dx3w16m0x2non]
add a convenience method for open_forwarded_tcpip_channel
-rw-r--r--paramiko/transport.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py
index 61aa1508..d4cffdc6 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -610,6 +610,19 @@ class Transport (threading.Thread):
"""
return self.open_channel('x11', src_addr=src_addr)
+ def open_forwarded_tcpip_channel(self, (src_addr, src_port), (dest_addr, dest_port)):
+ """
+ Request a new channel back to the client, of type C{"forwarded-tcpip"}.
+ This is used after a client has requested port forwarding, for sending
+ incoming connections back to the client.
+
+ @param src_addr: originator's address
+ @param src_port: originator's port
+ @param dest_addr: local (server) connected address
+ @param dest_port: local (server) connected port
+ """
+ return self.open_channel('forwarded-tcpip', (dest_addr, dest_port), (src_addr, src_port))
+
def open_channel(self, kind, dest_addr=None, src_addr=None):
"""
Request a new channel to the server. L{Channel}s are socket-like
@@ -741,7 +754,7 @@ class Transport (threading.Thread):
if not self.active:
return
self._tcp_handler = None
- self.global_request('cancel-tcpip-forward', (address, port), wait=False)
+ self.global_request('cancel-tcpip-forward', (address, port), wait=True)
def open_sftp_client(self):
"""