(network string)
| 204 | } |
| 205 | |
| 206 | func dialContext(network string) func(ctx context.Context, network, addr string) (net.Conn, error) { |
| 207 | return func(ctx context.Context, _, addr string) (net.Conn, error) { |
| 208 | return (&net.Dialer{ |
| 209 | Timeout: 30 * time.Second, |
| 210 | KeepAlive: 30 * time.Second, |
| 211 | DualStack: false, |
| 212 | }).DialContext(ctx, network, addr) |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | // visit visits a url and times the interaction. |
| 217 | // If the response is a 30x, visit follows the redirect. |