title: Set a custom WebProxy for a single HTTP request in .NET Core / UWP
body: <p>I need a simple HTTP GET request to work with a custom proxy. I'm not talking about getting the Windows default proxy settings here but custom ones.</p>
  
  <p>In a Xamarin Android app, the following code does work:</p>
  
  <pre><code>string myProxy = "100.100.100.100:7777";
  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri("http://my_uri"));
  request.Proxy = new WebProxy(myProxy, false);`
  </code></pre>
  
  <p>In an Windows Universal App project, the class <code>WebProxy</code> isn't implemented. So I followed this answer to create a custom implementation: <a href="https://stackoverflow.com/questions/35373327/location-of-iwebproxy-implementation-for-net-core#">Location of IWebProxy implementation for .NET Core</a></p>
  
  <p>My code is now:</p>
  
  <pre><code>public class MyProxy : IWebProxy
  {
      public Uri GetProxy(Uri destination)
      {                
         return new Uri("http://100.100.100.100:7777");
      }
  
      public bool IsBypassed(Uri host)
      {
          return false;
      }
  
      public ICredentials Credentials { get; set; }
  }
  </code></pre>
  
  <p>and then...</p>
  
  <pre><code>request.Proxy = new MyProxy();
  </code></pre>
  
  <p>It doesn't work though. In fact, if I set a breakpoint inside of <code>GetProxy</code>, it doesn't even get hit.
  It just ignores the Proxy setting and uses the Windows 10 default settings.</p>