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.

RoutingObject.cs 1.5 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Shadowsocks.Interop.V2Ray.Routing;
  2. using System.Collections.Generic;
  3. namespace Shadowsocks.Interop.V2Ray
  4. {
  5. public class RoutingObject
  6. {
  7. /// <summary>
  8. /// Gets or sets the domain strategy used for routing.
  9. /// Default value: AsIs.
  10. /// Available values: "AsIs" | "IPIfNonMatch" | "IPOnDemand"
  11. /// </summary>
  12. public string DomainStrategy { get; set; }
  13. /// <summary>
  14. /// Gets or sets the domain matcher used for routing.
  15. /// Default value: "linear".
  16. /// Available values: "linear" | "mph"
  17. /// </summary>
  18. public string DomainMatcher { get; set; }
  19. /// <summary>
  20. /// Gets or sets the list of routing rules.
  21. /// </summary>
  22. public List<RuleObject> Rules { get; set; }
  23. /// <summary>
  24. /// Gets or sets the list of load balancers.
  25. /// </summary>
  26. public List<BalancerObject>? Balancers { get; set; }
  27. public RoutingObject()
  28. {
  29. DomainStrategy = "AsIs";
  30. DomainMatcher = "linear";
  31. Rules = new();
  32. }
  33. public static RoutingObject Default => new()
  34. {
  35. DomainStrategy = "IPOnDemand",
  36. DomainMatcher = "mph",
  37. };
  38. public static RoutingObject DefaultBalancers => new()
  39. {
  40. DomainStrategy = "IPOnDemand",
  41. DomainMatcher = "mph",
  42. Balancers = new(),
  43. };
  44. }
  45. }