experimental.go 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. StoreDNS bool `json:"store_dns,omitempty"`
  17. }
  18. type ClashAPIOptions struct {
  19. ExternalController string `json:"external_controller,omitempty"`
  20. ExternalUI string `json:"external_ui,omitempty"`
  21. ExternalUIDownloadURL string `json:"external_ui_download_url,omitempty"`
  22. ExternalUIDownloadDetour string `json:"external_ui_download_detour,omitempty"`
  23. Secret string `json:"secret,omitempty"`
  24. DefaultMode string `json:"default_mode,omitempty"`
  25. ModeList []string `json:"-"`
  26. AccessControlAllowOrigin badoption.Listable[string] `json:"access_control_allow_origin,omitempty"`
  27. AccessControlAllowPrivateNetwork bool `json:"access_control_allow_private_network,omitempty"`
  28. // Deprecated: migrated to global cache file
  29. CacheFile string `json:"cache_file,omitempty"`
  30. // Deprecated: migrated to global cache file
  31. CacheID string `json:"cache_id,omitempty"`
  32. // Deprecated: migrated to global cache file
  33. StoreMode bool `json:"store_mode,omitempty"`
  34. // Deprecated: migrated to global cache file
  35. StoreSelected bool `json:"store_selected,omitempty"`
  36. // Deprecated: migrated to global cache file
  37. StoreFakeIP bool `json:"store_fakeip,omitempty"`
  38. }
  39. type V2RayAPIOptions struct {
  40. Listen string `json:"listen,omitempty"`
  41. Stats *V2RayStatsServiceOptions `json:"stats,omitempty"`
  42. }
  43. type V2RayStatsServiceOptions struct {
  44. Enabled bool `json:"enabled,omitempty"`
  45. Inbounds []string `json:"inbounds,omitempty"`
  46. Outbounds []string `json:"outbounds,omitempty"`
  47. Users []string `json:"users,omitempty"`
  48. }