convert localhost to 127.0.0.1 bypassing /etc/hosts which resolves to ::1 and fails on default docker setup

This commit is contained in:
Lex Berezhny 2019-01-15 15:24:08 -05:00
parent 7a8c2fc98b
commit 09b77972d9

View file

@ -154,6 +154,10 @@ class Env:
# permitted for an RPC server. # permitted for an RPC server.
if for_rpc and not result: if for_rpc and not result:
result = 'localhost' result = 'localhost'
if result == 'localhost':
# 'localhost' resolves to ::1 (ipv6) on many systems, which fails on default setup of
# docker, using 127.0.0.1 instead forces ipv4
result = '127.0.0.1'
return result return result
def sane_max_sessions(self): def sane_max_sessions(self):