From 16b04b8aec020d501d8defcac48bbea186bf9750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hildo=20Guillardi=20J=C3=BAnior?= <2211474+hildogjr@users.noreply.github.com> Date: Tue, 3 Aug 2021 16:47:05 -0300 Subject: [PATCH] Make local bind IP "localhost" Make local bind IP 127.0.0.1 instead 0.0.0.0 because normally is the behaviour expected: bind a local port to the server --- sshtunnel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sshtunnel.py b/sshtunnel.py index 52a23b3b..94380307 100644 --- a/sshtunnel.py +++ b/sshtunnel.py @@ -596,7 +596,7 @@ class SSHTunnelForwarder(object): the tuple are optional so both ``('', 8000)`` and ``('10.0.0.1', )`` are valid values - Default: ``('0.0.0.0', RANDOM_PORT)`` + Default: ``('127.0.0.1', RANDOM_PORT)`` .. versionchanged:: 0.0.8 Added the ability to use a UNIX domain socket as local bind @@ -1127,7 +1127,7 @@ def _consolidate_binds(local_binds, remote_binds): if count < 0: raise ValueError('Too many local bind addresses ' '(local_bind_addresses > remote_bind_addresses)') - local_binds.extend([('0.0.0.0', 0) for x in range(count)]) + local_binds.extend([('127.0.0.1', 0) for x in range(count)]) return local_binds @staticmethod