diff --git a/README.rst b/README.rst index 8462ae29..27993883 100644 --- a/README.rst +++ b/README.rst @@ -224,11 +224,12 @@ CLI usage usage: sshtunnel [-h] [-U SSH_USERNAME] [-p SSH_PORT] [-P SSH_PASSWORD] -R IP:PORT [IP:PORT ...] [-L [IP:PORT [IP:PORT ...]]] [-k SSH_HOST_KEY] [-K KEY_FILE] [-S KEY_PASSWORD] [-t] [-v] - [-V] [-x IP:PORT] [-c SSH_CONFIG_FILE] [-z] [-n] [-d [FOLDER [FOLDER ...]]] + [-V] [-x IP:PORT] [-c SSH_CONFIG_FILE] [-z] [-n] + [-d [FOLDER [FOLDER ...]]] ssh_address Pure python ssh tunnel utils - Version 0.1.5 + Version 0.2.0 positional arguments: ssh_address SSH server IP address (GW for SSH tunnels) diff --git a/changelog.rst b/changelog.rst index 412f56c6..583d7f04 100644 --- a/changelog.rst +++ b/changelog.rst @@ -12,10 +12,14 @@ CONTRIBUTORS - `Dan Harbin`_ - `Ignacio Peluffo`_ - `Niels Zeilemaker`_ +- `Georgy Rylov`_ CHANGELOG ========= +- v.0.2.0 (`Georgy Rylov`_) + + Support IPv6 without proxy command. Use built-in paramiko create socket logic. The logic tries to use ipv6 socket family first, then ipv4 socket family. + - v.0.1.5 (`JM Fernández`_) + Introduce `block_on_close` attribute @@ -121,6 +125,7 @@ CHANGELOG .. _Dan Harbin: https://github.com/RasterBurn .. _Ignacio Peluffo: https://github.com/ipeluffo .. _Niels Zeilemaker: https://github.com/NielsZeilemaker +.. _Georgy Rylov: https://github.com/g0djan .. _#13: https://github.com/pahaz/sshtunnel/issues/13 .. _#16: https://github.com/pahaz/sshtunnel/issues/16 .. _#19: https://github.com/pahaz/sshtunnel/issues/19 diff --git a/sshtunnel.py b/sshtunnel.py index 9eca1f86..0a37580e 100644 --- a/sshtunnel.py +++ b/sshtunnel.py @@ -36,7 +36,7 @@ input_ = input -__version__ = '0.1.5' +__version__ = '0.2.0' __author__ = 'pahaz' @@ -1111,11 +1111,13 @@ def _get_transport(self): self.logger.debug('Connecting via proxy: {0}'.format(proxy_repr)) _socket = self.ssh_proxy else: - _socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + _socket = (self.ssh_host, self.ssh_port) if isinstance(_socket, socket.socket): _socket.settimeout(SSH_TIMEOUT) _socket.connect((self.ssh_host, self.ssh_port)) transport = paramiko.Transport(_socket) + if isinstance(transport.sock, socket.socket): + transport.sock.settimeout(SSH_TIMEOUT) transport.set_keepalive(self.set_keepalive) transport.use_compression(compress=self.compression) transport.daemon = self.daemon_transport