title: C# Read proxy configuration from .PAC file
body: <p>I'm developing an app in Xamarin.Forms to run on android and my client uses a proxy setup through PAC file. I've looked around and haven't been able to find any solution on how to read the PAC script file specified in android configurations automatically and then create the web proxy object.</p>
  <p>Code in the below article reads proxy configurations if configured manually but not sure how to read the PAC url.</p>
  <pre><code>public WebProxy GetProxySettings()
  {
      var proxyHost = JavaSystem.GetProperty(&quot;http.proxyHost&quot;);
      var proxyPort = JavaSystem.GetProperty(&quot;http.proxyPort&quot;);
  
      return !string.IsNullOrEmpty(proxyHost) &amp;&amp; !string.IsNullOrEmpty(proxyPort)
          ? new WebProxy($&quot;{proxyHost}:{proxyPort}&quot;) 
          : null;
  }
  </code></pre>
  <p><a href="https://medium.com/@foxanna/httpclient-and-proxy-76835c784eab" rel="nofollow noreferrer">https://medium.com/@foxanna/httpclient-and-proxy-76835c784eab</a></p>