apocas / docker-modem

Docker Remote API network stack driver.
Apache License 2.0
234 stars 112 forks source link

IPv6 IP addresses #105

Closed chrmarti closed 5 years ago

chrmarti commented 5 years ago

The regex parsing the DOCKER_HOST URI does not support IPv6 IP addresses: https://github.com/apocas/docker-modem/blob/99fcf0d10521f974dbe335a47a09ecf30ca6c1a2/lib/modem.js#L28

E.g., 'tcp://[::1]:12345' would split at the second colon instead of the last. You could use Node.js' 'url' module instead of a regex.

apocas commented 5 years ago

Just pushed a fix to master. Will publish it later tonight :)

Node.js's url module doesn't handle strings without a protocol specified. (which happens in a few use cases) When a protocol isn't specified, docker-modem defaults to tcp:// then it uses Node.js URL.

apocas commented 5 years ago

Published in v2.0.1

chrmarti commented 5 years ago

@apocas Thanks for the quick fix!