Skip to content

Instantly share code, notes, and snippets.

@rarous
Created September 4, 2012 11:29
Show Gist options
  • Select an option

  • Save rarous/3620427 to your computer and use it in GitHub Desktop.

Select an option

Save rarous/3620427 to your computer and use it in GitHub Desktop.
private static bool ProxyTypeMatch(ProxyServerType server, RequiredProxyType required)
{
switch (required)
{
case RequiredProxyType.Any:
switch (server)
{
case ProxyServerType.Http:
case ProxyServerType.Socks4:
case ProxyServerType.Socks5:
return true;
}
break;
case RequiredProxyType.Http:
switch (server)
{
case ProxyServerType.Http:
return true;
}
break;
case RequiredProxyType.Socks:
switch (server)
{
case ProxyServerType.Socks4:
case ProxyServerType.Socks5:
return true;
}
break;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment