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.

PACSettings.cs 2.9 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Shadowsocks.PAC
  5. {
  6. /// <summary>
  7. /// Settings used for PAC.
  8. /// </summary>
  9. public class PACSettings
  10. {
  11. public PACSettings()
  12. {
  13. PACDefaultToDirect = false;
  14. PACServerEnableSecret = true;
  15. RegeneratePacOnVersionUpdate = true;
  16. CustomPACUrl = "";
  17. CustomGeositeUrl = "";
  18. CustomGeositeSha256SumUrl = "";
  19. GeositeDirectGroups = new List<string>()
  20. {
  21. "private",
  22. "cn",
  23. "geolocation-!cn@cn",
  24. };
  25. GeositeProxiedGroups = new List<string>()
  26. {
  27. "geolocation-!cn",
  28. };
  29. }
  30. /// <summary>
  31. /// Controls whether direct connection is used for
  32. /// hostnames not matched by blocking rules
  33. /// or matched by exception rules.
  34. /// Defaults to false, or whitelist mode,
  35. /// where hostnames matching the above conditions
  36. /// are connected to via proxy.
  37. /// Enable it to use blacklist mode.
  38. /// </summary>
  39. public bool PACDefaultToDirect { get; set; }
  40. /// <summary>
  41. /// Controls whether the PAC server uses a secret
  42. /// to protect access to the PAC URL.
  43. /// Defaults to true.
  44. /// </summary>
  45. public bool PACServerEnableSecret { get; set; }
  46. /// <summary>
  47. /// Controls whether `pac.txt` should be regenerated
  48. /// when shadowsocks-windows is updated.
  49. /// Defaults to true, so new changes can be applied.
  50. /// Change it to false if you want to manage `pac.txt`
  51. /// yourself.
  52. /// </summary>
  53. public bool RegeneratePacOnVersionUpdate { get; set; }
  54. /// <summary>
  55. /// Specifies a custom PAC URL.
  56. /// Leave empty to use local PAC.
  57. /// </summary>
  58. public string CustomPACUrl { get; set; }
  59. /// <summary>
  60. /// Specifies a custom Geosite database URL.
  61. /// Leave empty to use the default source.
  62. /// </summary>
  63. public string CustomGeositeUrl { get; set; }
  64. /// <summary>
  65. /// Specifies the custom Geosite database's corresponding SHA256 checksum download URL.
  66. /// Leave empty to disable checksum verification for your custom Geosite database.
  67. /// </summary>
  68. public string CustomGeositeSha256SumUrl { get; set; }
  69. /// <summary>
  70. /// A list of Geosite groups
  71. /// that we use direct connection for.
  72. /// </summary>
  73. public List<string> GeositeDirectGroups { get; set; }
  74. /// <summary>
  75. /// A list of Geosite groups
  76. /// that we always connect to via proxy.
  77. /// </summary>
  78. public List<string> GeositeProxiedGroups { get; set; }
  79. }
  80. }