always "tcp" for now, because for web properties that are ipv4-only cause connect-timeouts from incoming ipv6 connections. Instead of specifically returning "tcp6", we now let it be "tcp".
(a net.Addr)
| 195 | // cause connect-timeouts from incoming ipv6 connections. Instead of |
| 196 | // specifically returning "tcp6", we now let it be "tcp". |
| 197 | func tcp4or6(a net.Addr) (string, error) { |
| 198 | if addrport, err := netip.ParseAddrPort(a.String()); err == nil { |
| 199 | if addrport.Addr().Is6() || addrport.Addr().Is4In6() { |
| 200 | return /*tcp6*/ "tcp", nil |
| 201 | } else { |
| 202 | return /*tcp4*/ "tcp", nil |
| 203 | } |
| 204 | } else { |
| 205 | return "tcp", err |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | func underlyingConn(c net.Conn) net.Conn { |
| 210 | if wrap, ok := c.(*Conn); ok { |