From 927f21e3e5e8fcc76d374508d672c37fb2d2e9dc Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Sat, 4 Sep 2021 16:11:46 +0100 Subject: [PATCH] add v5 configure file skeleton --- infra/conf/v5cfg/skeleton.go | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 infra/conf/v5cfg/skeleton.go diff --git a/infra/conf/v5cfg/skeleton.go b/infra/conf/v5cfg/skeleton.go new file mode 100644 index 000000000..ebda68202 --- /dev/null +++ b/infra/conf/v5cfg/skeleton.go @@ -0,0 +1,51 @@ +package v5cfg + +import ( + "encoding/json" + "github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon" + "github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg" + "github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/proxycfg" + "github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/sniffer" + "github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/socketcfg" + "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/dns" + "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/log" + "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router" +) + +type RootConfig struct { + Log log.LogConfig `json:"log"` + DNS dns.DNSConfig `json:"dns"` + Router router.RouterConfig `json:"router"` + Inbounds []InboundConfig `json:"inbounds"` + Outbounds []OutboundConfig `json:"outbounds"` + Services map[string]json.RawMessage `json:"services"` +} + +type InboundConfig struct { + Protocol string `json:"protocol"` + PortRange *cfgcommon.PortRange `json:"port"` + ListenOn *cfgcommon.Address `json:"listen"` + Settings *json.RawMessage `json:"settings"` + Tag string `json:"tag"` + DomainOverride *cfgcommon.StringList `json:"domainOverride"` + SniffingConfig *sniffer.SniffingConfig `json:"sniffing"` + StreamSetting *StreamConfig `json:"streamSettings"` +} + +type OutboundConfig struct { + Protocol string `json:"protocol"` + SendThrough *cfgcommon.Address `json:"sendThrough"` + Tag string `json:"tag"` + Settings *json.RawMessage `json:"settings"` + StreamSetting *StreamConfig `json:"streamSettings"` + ProxySettings *proxycfg.ProxyConfig `json:"proxySettings"` + MuxSettings *muxcfg.MuxConfig `json:"mux"` +} + +type StreamConfig struct { + Transport string `json:"transport"` + TransportSettings json.RawMessage `json:"transportSettings"` + Security string `json:"security"` + SecuritySettings json.RawMessage `json:"securitySettings"` + SocketSettings socketcfg.SocketConfig `json:"socketSettings"` +}