Skip to content

Commit 372c7c0

Browse files
authored
feat: support unix socket proxy & IPV6 (#199)
1 parent 33b537a commit 372c7c0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/resty/etcd/v3.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,12 @@ function _M.new(opts)
436436
connect_opts.client_key = cli.ssl_key_path
437437
connect_opts.trusted_ca = opts.trusted_ca
438438

439-
-- TODO: implement proxing via unix socket once we have support sync conf via gRPC
440-
-- TODO: we don't support IPv6 yet, should the user pass `[host]:port` so we don't need
441-
-- to adapt it?
442-
local conn, err = grpc.connect(endpoint.address .. ":" .. endpoint.port, connect_opts)
439+
local conn, err
440+
if unix_socket_proxy then
441+
conn, err = grpc.connect(unix_socket_proxy, connect_opts)
442+
else
443+
conn, err = grpc.connect(endpoint.address .. ":" .. endpoint.port, connect_opts)
444+
end
443445
if not conn then
444446
return nil, err
445447
end

0 commit comments

Comments
 (0)