Reputation: 2677
my client is behind a corporate proxy on http://localhost:9000/
. I've tried to set the Proxy in my .Net Core 5 WebApi App via that code:
var client = new CosmosClient(dbConfig.GetValue<string>("Endpoint"), dbConfig.GetValue<string>("Key"), new CosmosClientOptions()
{
WebProxy = new WebProxy("http://localhost:9000/", true)
});
But the connection is not Working. I receive a Service unavailable
. After closing proxy connection and having direct internet access my .Net backend is working. Any idea?
Upvotes: 1
Views: 1377
Reputation: 2677
Looks like the answer is Gateway
-mode:
var client = new CosmosClient(dbConfig.GetValue<string>("Endpoint"), dbConfig.GetValue<string>("Key"), new CosmosClientOptions()
{
WebProxy = new WebProxy("http://localhost:9000/", true),
ConnectionMode = ConnectionMode.Gateway
});
Upvotes: 4