func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
	conn, err := d.Dialer.DialContext(ctx, network, addr)
	if err != nil {
		return nil, err
	}

	header := d.HeaderProvider(ctx, conn)
	if header == nil {
		return conn, nil
	}
	_, err = header.WriteTo(conn)
	if err != nil {
		return nil, err
	}
	return conn, nil
}
// DialContext implements the dialer, calling `HeaderProvider` for a the context passed to it.
DialContext implements the dialer, calling `HeaderProvider` for a the context passed to it.
// DialContext implements the dialer calling ` HeaderProvider ` for a the context passed to it .
func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
	conn, err := d.Dialer.DialContext(ctx, network, addr)
	if err != nil {
		return nil, err
	}
	header := d.HeaderProvider(ctx, conn)
	if header == nil {
		return conn, nil
	}
	_, err = header.WriteTo(conn)
	if err != nil {
		return nil, err
	}
	return conn, nil
}
func ( d * Dialer ) DialContext ( ctx context . Context , network , addr string ) ( net . Conn , error ) { conn , err := d . Dialer . DialContext ( ctx , network , addr ) if err != nil { return nil , err } header := d . HeaderProvider ( ctx , conn ) if header == nil { return conn , nil } _ , err = header . WriteTo ( conn ) if err != nil { return nil , err } return conn , nil }
DialContext implements the dialer, calling `HeaderProvider` for a the context passed to it.
DialContext implements the dialer calling ` HeaderProvider ` for a the context passed to it .