You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProxyConfig.cs 1.1 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. namespace Shadowsocks.Model
  3. {
  4. [Serializable]
  5. public class ProxyConfig
  6. {
  7. public const int PROXY_SOCKS5 = 0;
  8. public const int PROXY_HTTP = 1;
  9. public const int MaxProxyTimeoutSec = 10;
  10. private const int DefaultProxyTimeoutSec = 3;
  11. public bool useProxy;
  12. public int proxyType;
  13. public string proxyServer;
  14. public int proxyPort;
  15. public int proxyTimeout;
  16. public bool useAuth;
  17. public string authUser;
  18. public string authPwd;
  19. public ProxyConfig()
  20. {
  21. useProxy = false;
  22. proxyType = PROXY_SOCKS5;
  23. proxyServer = "";
  24. proxyPort = 0;
  25. proxyTimeout = DefaultProxyTimeoutSec;
  26. useAuth = false;
  27. authUser = "";
  28. authPwd = "";
  29. }
  30. public void CheckConfig()
  31. {
  32. if (proxyType < PROXY_SOCKS5 || proxyType > PROXY_HTTP)
  33. {
  34. proxyType = PROXY_SOCKS5;
  35. }
  36. }
  37. }
  38. }