2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-09-08 19:28:38 +00:00

Change default host to localhost only

Also, fix support for IPv4 addresses as bind_host
This commit is contained in:
Jarrod Johnson
2025-05-02 16:18:28 -04:00
parent 89437ee761
commit 57ada3728c

View File

@@ -1226,8 +1226,9 @@ def serve(bind_host, bind_port):
bind_host, family=socket.AF_UNIX)
os.chmod(bind_host, 0o666)
else:
addrinfo = socket.getaddrinfo(bind_host, bind_port)[0]
sock = eventlet.listen(
(bind_host, bind_port, 0, 0), family=socket.AF_INET6)
addrinfo[-1], family=addrinfo[0])
except socket.error as e:
if e.errno != 98:
raise
@@ -1251,7 +1252,7 @@ def serve(bind_host, bind_port):
class HttpApi(object):
def __init__(self, bind_host=None, bind_port=None):
self.server = None
self.bind_host = bind_host or '::'
self.bind_host = bind_host or '127.0.0.1'
self.bind_port = bind_port or 4005
def start(self):