Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for IPv6 addresses #124

Open
joel0 opened this issue Jul 13, 2022 · 3 comments
Open

Support for IPv6 addresses #124

joel0 opened this issue Jul 13, 2022 · 3 comments

Comments

@joel0
Copy link

joel0 commented Jul 13, 2022

wait-for-it mangles IPv6 address literals by considering the first : as the end of the host field.

$ ./wait-for-it.sh "[2607:f8b0:400e:c08::66]:80"
wait-for-it.sh: waiting 15 seconds for [2607:f8b0
wait-for-it.sh: timeout occurred after waiting 15 seconds for [2607:f8b0

$ ./wait-for-it.sh "[::1]"
wait-for-it.sh: waiting 15 seconds for [:1]
wait-for-it.sh: timeout occurred after waiting 15 seconds for [:1]
@atkrad
Copy link

atkrad commented Oct 14, 2022

Hey @joel0
You can use the Wait4X, it supports IPV6:

wait4x tcp '[::1]:3306'

@juliaszone
Copy link

Sadly this script is outdated. I'm looking into updating it for IPv6 using RFCs. No guarantees tho, as I have limited mental capacity ATM.

@juliaszone
Copy link

juliaszone commented May 30, 2024

A very easy fix idea: splitting by the last colon matched, not the first. That should do the trick.
Text representation can be found here: https://datatracker.ietf.org/doc/html/rfc2373#section-2.2
Maybe it's better to add a regex checking for Domain/IPv6/IPv4. I'll also see about the connections that the script makes, to make sure it follows happy eyeballs for domains: https://datatracker.ietf.org/doc/html/rfc8305
netcat to my knowledge is very sticky to one protocol unless specified differently. Maybe I'd check both IPv6 and IPv4 if a domain resolves to both.

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

No branches or pull requests

3 participants