예제 #1
0
web::http::uri blob_service_test_base::defiddler(const web::http::uri& uri)
{
    if (uri.host() == U("ipv4.fiddler"))
    {
        web::http::uri_builder builder(uri);
        builder.set_host(U("127.0.0.1"));
        return builder.to_uri();
    }

    return uri;
}
    cloud_storage_account cloud_storage_account::get_development_storage_account(const web::http::uri& proxy_uri)
    {
        web::http::uri_builder builder;
        if (!proxy_uri.is_empty())
        {
            builder.set_scheme(proxy_uri.scheme());
            builder.set_host(proxy_uri.host());
        }
        else
        {
            builder.set_scheme(U("http"));
            builder.set_host(U("127.0.0.1"));
        }

        builder.set_path(devstore_account_name);

        builder.set_port(10000);
        auto blob_endpoint = storage_uri(builder.to_uri());

        builder.set_port(10001);
        auto queue_endpoint = storage_uri(builder.to_uri());

        builder.set_port(10002);
        auto table_endpoint = storage_uri(builder.to_uri());

        auto credentials = storage_credentials(devstore_account_name, devstore_account_key);
        auto account = cloud_storage_account(credentials, blob_endpoint, queue_endpoint, table_endpoint);
        
        account.m_is_development_storage_account = true;
        account.m_settings.insert(std::make_pair(use_development_storage_setting_string, use_development_storage_setting_value));
        if (!proxy_uri.is_empty())
        {
            account.m_settings.insert(std::make_pair(development_storage_proxy_uri_setting_string, proxy_uri.to_string()));
        }
        
        return account;
    }