Browse Source

Disable forbidden ip feature for local shadowsocks

Since forbidden ip is server-side only, disable it for local-side.
This commit also supress warning about IPv6 loopback because I can
confirm ::1/128 is the only loopback address, not like IPv4.
master
Sunny 10 years ago
parent
commit
070108f78b
  1. 3
      shadowsocks/utils.py

3
shadowsocks/utils.py

@ -186,7 +186,6 @@ def get_config(is_local):
config['verbose'] = config.get('verbose', False) config['verbose'] = config.get('verbose', False)
config['local_address'] = config.get('local_address', '127.0.0.1') config['local_address'] = config.get('local_address', '127.0.0.1')
config['local_port'] = config.get('local_port', 1080) config['local_port'] = config.get('local_port', 1080)
config['forbidden_ip'] = IPNetwork(config.get('forbidden_ip', '127.0.0.0/8,::1'))
if is_local: if is_local:
if config.get('server', None) is None: if config.get('server', None) is None:
logging.error('server addr not specified') logging.error('server addr not specified')
@ -194,6 +193,8 @@ def get_config(is_local):
sys.exit(2) sys.exit(2)
else: else:
config['server'] = config.get('server', '0.0.0.0') config['server'] = config.get('server', '0.0.0.0')
config['forbidden_ip'] = \
IPNetwork(config.get('forbidden_ip', '127.0.0.0/8,::1/128'))
config['server_port'] = config.get('server_port', 8388) config['server_port'] = config.get('server_port', 8388)
if is_local and not config.get('password', None): if is_local and not config.get('password', None):

Loading…
Cancel
Save