influxdata / influxdb-client-java

InfluxDB 2 JVM Based Clients
https://influxdata.github.io/influxdb-client-java/
MIT License
431 stars 129 forks source link

IPv6 hosts are not supported #623

Closed tedpearson closed 4 months ago

tedpearson commented 1 year ago

https://github.com/influxdata/influxdb-client-java/blob/886eb8840b4d72fdb9973801ba4cd6e1d6fa1306/client/src/main/java/com/influxdb/client/InfluxDBClientOptions.java#L697

The InfluxDBClientOptions.ParsedUrl constructor strips the square brackets off IPv6 addresses, rendering urls containing them invalid. E.g. http://[2001:db8:3333:4444:5555:6666:7777:8888]:8086/ becomes http://2001:db8:3333:4444:5555:6666:7777:8888:8086/.

See how okhttp3 HttpUrl.Builder.toString() handles IPv6 addresses.

bednar commented 1 year ago

Hi @tedpearson,

thanks for using our client.

Is this something you would be willing to help with? All PR is welcome and we will be happy to review your submission.

Regards