-
Hi @lubocode! I saw this 2 lines last day and could not really interpret what it does... What was your goal when you wrote that? this is a go playground example and the result does not seem very useful but maybe I'm missing something... for example, what does |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Well, I assumed the writing of the IPv6 address as [IPv6address]:port, and as such, one would get the port and IPv6 address separated, no matter how the address itself is written. This is the way I have learned to use ports with IPv6 addresses, but if you know another, then please go ahead and mention it, so that those lines can be changed accordingly. An example address would be |
Beta Was this translation helpful? Give feedback.
-
This solution also takes into account IPv4 addresses which will only have one Maybe adding a comment along the lines of |
Beta Was this translation helpful? Give feedback.
Well, I assumed the writing of the IPv6 address as [IPv6address]:port, and as such, one would get the port and IPv6 address separated, no matter how the address itself is written. This is the way I have learned to use ports with IPv6 addresses, but if you know another, then please go ahead and mention it, so that those lines can be changed accordingly.
An example address would be
[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443
(Taken from Wikipedia. No idea where that leads^^)