The primary issue with the code is its inability to handle IPv6 addresses. The hostname we provides may include hostname or both IPv4 and IPv6 addresses. However, the ssh.Dial function expects an address in the format host:port, which might not be directly compatible with IPv6 addresses, especially when they contain multiple colons. So i use net.JoinHostPort to fix ipv6 address at createSystemConnection.
After fix, it can handle ipv6 address currectly now. I tested with dualstack domain, single ipv4/ipv6 domain and single ipv4/ipv6 address, it all works fine now.
The only change for IPv6 address now is not require a [], just input the ip.
https://github.com/henrygd/beszel/blob/4e64d9efad9299c29f96c8a892adbad89c726ab8/beszel/internal/hub/hub.go#L374
The primary issue with the code is its inability to handle IPv6 addresses. The hostname we provides may include hostname or both IPv4 and IPv6 addresses. However, the
ssh.Dial
function expects an address in the format host:port, which might not be directly compatible with IPv6 addresses, especially when they contain multiple colons. So i usenet.JoinHostPort
to fix ipv6 address at createSystemConnection.After fix, it can handle ipv6 address currectly now. I tested with dualstack domain, single ipv4/ipv6 domain and single ipv4/ipv6 address, it all works fine now.
The only change for IPv6 address now is not require a
[]
, just input the ip.