(u *url.URL)
| 120 | var errMalformedURL = errors.New("malformed ws or wss URL") |
| 121 | |
| 122 | func hostPortNoPort(u *url.URL) (hostPort, hostNoPort string) { |
| 123 | hostPort = u.Host |
| 124 | hostNoPort = u.Host |
| 125 | if i := strings.LastIndex(u.Host, ":"); i > strings.LastIndex(u.Host, "]") { |
| 126 | hostNoPort = hostNoPort[:i] |
| 127 | } else { |
| 128 | switch u.Scheme { |
| 129 | case "wss": |
| 130 | hostPort += ":443" |
| 131 | case "https": |
| 132 | hostPort += ":443" |
| 133 | default: |
| 134 | hostPort += ":80" |
| 135 | } |
| 136 | } |
| 137 | return hostPort, hostNoPort |
| 138 | } |
| 139 | |
| 140 | // DefaultDialer is a dialer with all fields set to the default values. |
| 141 | var DefaultDialer = &Dialer{ |
no outgoing calls
searching dependent graphs…