Skip to content

fix: bracket bare IPv6 literals for the gRPC channel target - #173

Merged
anush008 merged 1 commit into
qdrant:masterfrom
ivandasch:fix/ipv6-literal-host
Nov 5, 2026
Merged

anush008 merged 1 commit into
qdrant:masterfrom
ivandasch:fix/ipv6-literal-host

Conversation

@ivandasch

Copy link
Copy Markdown
Contributor

In createChannel, bracket the host when it is a bare IPv6 literal (contains : and no brackets) before calling ManagedChannelBuilder.forAddress, so the channel target becomes dns:///[fd00::1]:6334 and parses correctly.

Already-bracketed hosts and hostnames are unaffected.

Mirrors the Go client behavior (net.JoinHostPort in getAddr).

Fixes #172

ManagedChannelBuilder.forAddress("fd00::1", port) builds the channel
target dns:///fd00::1:6334, which gRPC cannot parse. Bracket bare IPv6
literals before creating the channel, mirroring what the Go client
does with net.JoinHostPort. Already-bracketed and hostname inputs are
unaffected.

@anush008 anush008 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for taking the time to contribute @ivandasch!

@anush008
anush008 merged commit 3488a57 into qdrant:master Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IPv6 literal host: channel target is invalid for a bare IPv6 address

2 participants