In the Notification Hubs .NET API using NotificationHubSettings, a proxy can be supplied during client construction:

var settings = new Microsoft.Azure.NotificationHubs.NotificationHubSettings
{
    Proxy = new System.Net.WebProxy("http://proxy.example:8080")
};
var hub = new Microsoft.Azure.NotificationHubs.NotificationHubClient(
    hubConnectionString, hubName, settings);

The connection string and hub name remain the service configuration. A public HTTP endpoint from the HTTP proxy list can fill the WebProxy address in the default construction path.

There is an ordering rule in that constructor:

  1. A supplied HttpClient is used first.
  2. Otherwise, a supplied MessageHandler creates the HTTP client.
  3. Otherwise, Proxy creates a proxy-configured HttpClientHandler.
  4. With none supplied, the constructor creates its default HTTP client.

If the application already supplies HttpClient or MessageHandler, configure that transport's proxy instead of expecting the separate Proxy property to override it.

For a proxy account, set credentials on the WebProxy before construction. They authenticate to the intermediary, not to the Notification Hub.

Older examples name NotificationHubClientSettings. Match the settings type and constructor exposed by the installed package rather than mixing that name into an API expecting NotificationHubSettings.

Tënë sô zo