public override bool GetProxies(Uri destination, out IList <string> proxyList)
{
try
{
proxyList = null;
EnsureEngineAvailable();
// after EnsureEngineAvailable we expect State to be CompilationSuccess, otherwise return.
if (State != AutoWebProxyState.Completed)
{
// the script can't run, say we're not ready and bypass
return(false);
}
bool result = false;
try
{
string proxyListString = scriptInstance.FindProxyForURL(destination.ToString(), destination.Host);
GlobalLog.Print("NetWebProxyFinder#" + ValidationHelper.HashString(this) + "::GetProxies() calling ExecuteFindProxyForURL() for destination:" + ValidationHelper.ToString(destination) + " returned scriptReturn:" + ValidationHelper.ToString(proxyList));
proxyList = ParseScriptResult(proxyListString);
result = true;
}
catch (Exception exception)
{
if (Logging.On)
{
Logging.PrintWarning(Logging.Web, SR.GetString(SR.net_log_proxy_script_execution_error, exception));
}
}
return(result);
}
finally
{
// Reset state of 'aborted', since next call to GetProxies() must not use previous aborted state.
aborted = false;
}
}