public static WebProxy GetLocalServerProxy(bool isEndPointExternal)
        {
            Uri localServerProxyAddress = RmsClientManagerUtils.GetLocalServerProxyAddress();

            if (localServerProxyAddress == null)
            {
                Microsoft.Exchange.Diagnostics.Components.Data.Storage.ExTraceGlobals.RightsManagementTracer.TraceDebug(0L, "No proxy is configured. Using system defaults");
                return(null);
            }
            if (isEndPointExternal)
            {
                Microsoft.Exchange.Diagnostics.Components.Data.Storage.ExTraceGlobals.RightsManagementTracer.TraceDebug <Uri>(0L, "InternetWeb proxy is configured {0}. Using that to connect to external endpoint", localServerProxyAddress);
                return(new WebProxy(localServerProxyAddress, true));
            }
            Microsoft.Exchange.Diagnostics.Components.Data.Storage.ExTraceGlobals.RightsManagementTracer.TraceDebug <Uri>(0L, "InternetWeb proxy is configured {0} but the end point is internal. Connecting directly", localServerProxyAddress);
            return(RmsClientManagerUtils.EmptyWebProxy);
        }