2017-11-03 56 views
1

我想是這樣的:如何覆蓋AWS-SDK-CPP端點在本地主機連接到服務器minio:9000

Aws::Client::ClientConfiguration config; 
config.endpointOverride = Aws::String("localhost:9000"); 

它不工作。

看來,AWS-SDK-CPP默認使用虛擬主機:

https://bucket-name/s3.amazonaws.com 

但是,要訪問Minio,我們需要路徑的方式來訪問:

https://localhost:9000/minio/bucket-name 

在AWS-SDK-JAVA ,有:

AmazonS3ClientBuilder.withPathStyleAccessEnabled(true) 

AWS-SDK-CPP中是否有類似的東西?

回答

1

路徑風格和虛擬主機之間的切換是在S3Client構造:

S3Client(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration(), bool signPayloads = false, bool useVirtualAdressing = true); 

將其關閉,如在:

Aws::Client::ClientConfiguration config; 
config.endpointOverride = Aws::String("172.31.30.127:9000"); 
config.scheme = Aws::Http::Scheme::HTTP; 
auto client = Aws::MakeShared<S3Client>("sample_s3_client", config, false, false); 
相關問題