Skip to content

Commit

Permalink
Make local bind IP "localhost"
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hildogjr authored Aug 3, 2021
1 parent 58a46ef commit 16b04b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sshtunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

1 comment on commit 16b04b8

@loecho-sec
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一c

Please sign in to comment.