Upload file fails while I try to upload from company network to Azure IoT Hub. Network team suggested to go through another proxy. Implemented proxy as mention in below code but doubt that this code is not respecting proxy settings and upload still fails. Am I missing anything here?
var conSettings = new Http1TransportSettings
{
Proxy = new System.Net.WebProxy {
UseDefaultCredentials = true,
Address = new Uri("http://proxy.com:1234"),
BypassProxyOnLocal = true
}
};
using(var deviceClient = DeviceClient.CreateFromConnectionString(conString, "xxx:xxx:xxx:xxx", new ITransportSettings[] { conSettings }))
using(var sourceData = new FileStream(file, FileMode.Open))
{
await deviceClient.UploadToBlobAsync(fileName, sourceData);
}
How to ensure that this code is making request using given proxy settings?