skeleton.go 2.0 KB

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