skeleton.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package v5cfg
  2. import (
  3. "encoding/json"
  4. "github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon"
  5. "github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/muxcfg"
  6. "github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/proxycfg"
  7. "github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/sniffer"
  8. "github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/socketcfg"
  9. )
  10. type RootConfig struct {
  11. LogConfig json.RawMessage `json:"log"`
  12. DNSConfig json.RawMessage `json:"dns"`
  13. RouterConfig json.RawMessage `json:"router"`
  14. Inbounds []InboundConfig `json:"inbounds"`
  15. Outbounds []OutboundConfig `json:"outbounds"`
  16. Services map[string]json.RawMessage `json:"services"`
  17. Extensions []json.RawMessage `json:"extension"`
  18. }
  19. type InboundConfig struct {
  20. Protocol string `json:"protocol"`
  21. PortRange *cfgcommon.PortRange `json:"port"`
  22. ListenOn *cfgcommon.Address `json:"listen"`
  23. Settings json.RawMessage `json:"settings"`
  24. Tag string `json:"tag"`
  25. SniffingConfig *sniffer.SniffingConfig `json:"sniffing"`
  26. StreamSetting *StreamConfig `json:"streamSettings"`
  27. }
  28. type OutboundConfig struct {
  29. Protocol string `json:"protocol"`
  30. SendThrough *cfgcommon.Address `json:"sendThrough"`
  31. Tag string `json:"tag"`
  32. Settings json.RawMessage `json:"settings"`
  33. StreamSetting *StreamConfig `json:"streamSettings"`
  34. ProxySettings *proxycfg.ProxyConfig `json:"proxySettings"`
  35. MuxSettings *muxcfg.MuxConfig `json:"mux"`
  36. DomainStrategy string `json:"domainStrategy"`
  37. }
  38. type StreamConfig struct {
  39. Transport string `json:"transport"`
  40. TransportSettings json.RawMessage `json:"transportSettings"`
  41. Security string `json:"security"`
  42. SecuritySettings json.RawMessage `json:"securitySettings"`
  43. SocketSettings socketcfg.SocketConfig `json:"socketSettings"`
  44. }