Markus Armbruster, le lun. 01 mars 2021 09:15:41 +0100, a ecrit: > Samuel Thibault <samuel.thiba...@gnu.org> writes: > > Specifying [127.0.0.1] would be odd, but for instance > > > > ssh localhost -D '[127.0.0.1]':23456 > > > > happens to listen on 127.0.0.1. So I would say that common practice > > really is that [] only matters for syntax, and not semantic. > > I believe common syntactic practice is to use [brackets] only around > numeric IPv6 addresses. E.g. socat(1): > > IP address > An IPv4 address in numbers-and-dots notation, an IPv6 address in > hex notation enclosed in brackets, or a hostname that resolves > to an IPv4 or an IPv6 address. > Examples: 127.0.0.1, [::1], www.dest-unreach.org, dns1
Yes and that's also what ssh documents, but in ssh the brackets happen to also work for an IPv4 address. Samuel