1
0

experimental.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package option
  2. import "github.com/sagernet/sing/common/json/badoption"
  3. type ExperimentalOptions struct {
  4. CacheFile *CacheFileOptions `json:"cache_file,omitempty"`
  5. ClashAPI *ClashAPIOptions `json:"clash_api,omitempty"`
  6. V2RayAPI *V2RayAPIOptions `json:"v2ray_api,omitempty"`
  7. Debug *DebugOptions `json:"debug,omitempty"`
  8. }
  9. type CacheFileOptions struct {
  10. Enabled bool `json:"enabled,omitempty"`
  11. Path string `json:"path,omitempty"`
  12. CacheID string `json:"cache_id,omitempty"`
  13. StoreFakeIP bool `json:"store_fakeip,omitempty"`
  14. StoreRDRC bool `json:"store_rdrc,omitempty"`
  15. RDRCTimeout badoption.Duration `json:"rdrc_timeout,omitempty"`
  16. }
  17. type ClashAPIOptions struct {
  18. ExternalController string `json:"external_controller,omitempty"`
  19. ExternalUI string `json:"external_ui,omitempty"`
  20. ExternalUIDownloadURL string `json:"external_ui_download_url,omitempty"`
  21. ExternalUIDownloadDetour string `json:"external_ui_download_detour,omitempty"`
  22. Secret string `json:"secret,omitempty"`
  23. DefaultMode string `json:"default_mode,omitempty"`
  24. ModeList []string `json:"-"`
  25. AccessControlAllowOrigin badoption.Listable[string] `json:"access_control_allow_origin,omitempty"`
  26. AccessControlAllowPrivateNetwork bool `json:"access_control_allow_private_network,omitempty"`
  27. // Deprecated: migrated to global cache file
  28. CacheFile string `json:"cache_file,omitempty"`
  29. // Deprecated: migrated to global cache file
  30. CacheID string `json:"cache_id,omitempty"`
  31. // Deprecated: migrated to global cache file
  32. StoreMode bool `json:"store_mode,omitempty"`
  33. // Deprecated: migrated to global cache file
  34. StoreSelected bool `json:"store_selected,omitempty"`
  35. // Deprecated: migrated to global cache file
  36. StoreFakeIP bool `json:"store_fakeip,omitempty"`
  37. }
  38. type V2RayAPIOptions struct {
  39. Listen string `json:"listen,omitempty"`
  40. Stats *V2RayStatsServiceOptions `json:"stats,omitempty"`
  41. }
  42. type V2RayStatsServiceOptions struct {
  43. Enabled bool `json:"enabled,omitempty"`
  44. Inbounds []string `json:"inbounds,omitempty"`
  45. Outbounds []string `json:"outbounds,omitempty"`
  46. Users []string `json:"users,omitempty"`
  47. }